about | help | code help+videos | done | prefs |
Given an ArrayList of Integers called lst, insert a new element at index pos, the value of which is the size (number of elements) of the ArrayList. Note that this works easily because the size is an int and the ArrayList stores Integers. Return the modified ArrayList as output. Precondition: pos will not be negative, and will always be less than the number of elements in lst.HINTThe add method with two parameters uses the first parameter as the new index. apcsaListAddSize([3, 4, 5], 2) → [3, 4, 3, 5] apcsaListAddSize([5, 0, 3], 0) → [3, 5, 0, 3] apcsaListAddSize([1, 2, 4, 5, 6, 10], 3) → [1, 2, 4, 6, 5, 6, 10] ...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: 220
Copyright Nick Parlante 2017 - privacy