Insist on doing small things, then witness the magic
12345678910111213141516
class Solution { public long minimumHealth(int[] damage, int armor) { long sum = 0; long max = -1; for (int num : damage) { max = Math.max(max, num); sum += num; } if (armor >= max) { sum -= max; } else { sum -= armor; } return sum + 1; }}
偶然发现的题. 应该是easy 难度.
Calm Patient Persistent