Chief Hopper Time : O(n) Space : O(1) 1234567long long chiefHopper(vector<int> arr) { long long res = 0; for(int i = arr.size() - 1; i >= 0; i--) { res = ceil((res + arr[i]) / 2.0); } return res;}