id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

orion.a.smith@gmail.com apcsa-lists > apcsaListInsertThrice
prev  |  next  |  chance

Given an ArrayList of Integers and an int val, insert three elements at the beginning. The first has the value of the val parameter, the second has the value 2*val, the third has the value 3*val. Return the modified ArrayList.


apcsaListInsertThrice([0], 4) → [4, 8, 12, 0]
apcsaListInsertThrice([15, 17], 1) → [1, 2, 3, 15, 17]
apcsaListInsertThrice([10, 11], 0) → [0, 0, 0, 10, 11]

...Save, Compile, Run (ctrl-enter)

public ArrayList<Integer> apcsaListInsertThrice(ArrayList<Integer> lst, int val) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 120

Copyright Nick Parlante 2017 - privacy