Teemo attacks Ashe with poison. An attack at second t poisons Ashe for exactly duration seconds, covering the inclusive interval [t, t + duration - 1]. If Teemo attacks again before the poison wears off, the timer resets: the poison now ends duration seconds after the new attack.
You are given a non-decreasing integer array timeSeries, where timeSeries[i] is the second of the i-th attack, and an integer duration.
Return the total number of seconds that Ashe is poisoned.