MinHealthGame
https://leetcode.com/discuss/interview-question/1789737/amazon-OA
Last updated
https://leetcode.com/discuss/interview-question/1789737/amazon-OA
Last updated
进阶班: Solution:
Intuition: Get the maximum answer possible i.e. sum of all elements now use the armor only for the maximum element because we want the answer to be minimum and also add + 1 to it because health at any stage cannot be 0. Logic for this is : Sum of all the elements - min(armor, maximum element)+1