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

 

listReplaceZeros


Given a List of Integers lst and a number num, replace all the zero entries in lst with num. Return the List.


listReplaceZeros([0, 5], 3) → [3, 5]
listReplaceZeros([5, 0, 3, 2, 0], -10) → [5, -10, 3, 2, -10]
listReplaceZeros([2, 32, 33, 0], 1) → [2, 32, 33, 1]

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

public ArrayList<Integer> listReplaceZeros(ArrayList<Integer> lst, int num){ }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy