Chief Hopper Discussions | Algorithms | HackerRank
  • + 0 comments

    Easy Solution

     public static int chiefHopper(List<Integer> arr) {
            int E = 0;
            for (int i = arr.size() - 1; i >= 0; i--){
                E = (int) Math.ceil((E + arr.get(i)) / 2.0); 
            }
            return E;
        }