about | help | code help+videos | done | prefs |
Given an ArrayList of Integers called lst, add a new element to the end, the value of which is the index of the largest element in the ArrayList. Return the ArrayList as output. If the largest element in the List occurs more than once, only add one element to the end of the list with the index of where the largest element occurs first (lowest index).HINTYou will need to use a loop here, but the methodology will be slightly different from the last problem. apcsaListAddLargestIndex([3, 4, 5]) → [3, 4, 5, 2] apcsaListAddLargestIndex([1, 2, 4, 5, 6, 10]) → [1, 2, 4, 5, 6, 10, 5] apcsaListAddLargestIndex([5, 0, 3]) → [5, 0, 3, 0] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy