Riot Games

1 DSA problems asked in Riot Games coding interviews

1 Easy
0 Medium
0 Hard
​

1 problem

Arrays & Hashing
1
Teemo Attacking
Easy

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*.