Teemo Attacking Solution Java
class Solution {\n  public int findPoisonedDuration(int[] timeSeries, int duration) {\n    if (duration == 0)\n      return 0;\n\n    int ans = 0;\n\n    for (i
class Solution {\n  public int findPoisonedDuration(int[] timeSeries, int duration) {\n    if (duration == 0)\n      return 0;\n\n    int ans = 0;\n\n    for (int i = 0; i + 1 < timeSeries.length; ++i)\n      ans += Math.min(timeSeries[i + 1] - timeSeries[i], duration);\n\n    return ans + duration;\n  }\n}\n
['Array', 'Simulation']