You are viewing a single comment's thread. Return to all comments →
Java O(n)
public static int chiefHopper(List<Integer> arr) { int energy = 0; for (int i = arr.size() - 1; i >= 0; i--) { energy = (energy + arr.get(i) + 1) / 2; } return energy; }
Seems like cookies are disabled on this browser, please enable them to open this website
Chief Hopper
You are viewing a single comment's thread. Return to all comments →
Java O(n)