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

 

bePositive


Given an array of integers, return a new array that only contains the positive numbers from the original array. The positive values must be copied in the same order as found in the original array.


bePositive([5, -3, 9]) → [5, 9]
bePositive([-7, 2, 3, 0, 8]) → [2, 3, 8]
bePositive([6, 1, 5]) → [6, 1, 5]

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

public int [] bePositive( 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: 200 Post-solution available

Copyright Nick Parlante 2017 - privacy