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

 

removeZeros


Return an array made up of all the elements in the incoming array that are not equal to zero. Return null if there aren't any non-zero elements to be returned, The incoming array will have at least one number in it.


removeZeros([3, 0, 4]) → [3, 4]
removeZeros([0, 0, 0, 1]) → [1]
removeZeros([0, 0]) → null

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

public int[] removeZeros(int[] nums){ }

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: 270 Post-solution available

Copyright Nick Parlante 2017 - privacy