Company: Uber
Difficulty: medium
Character Health Tracker Imagine a video game where the player controls a character to go through several levels. The character has an initial health value of initialHealth , and this value changes as the player goes through levels of the game. You are given an array of integers deltas , defining each health value change. Specifically, the i th level (0-indexed) changes the character\'s current health value by deltas[i] . Note that whenever the current health value becomes less than 0 , it immediately gets set to 0 . Similarly, whenever the current health value becomes greater than 100 , it immediately gets set to 100 . Your task is to return the character\'s final health value after the player goes through all levels of the game. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(deltas.length) will fit within the execution time limit. Input Format Integer initialHealth Array of integers deltas Constraints Execution ti