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

 

test2022_01_20_APSLHL_sumUp


Write a method that returns the sum of all the non-negative numbers in the given array of integers. Look at the test data for examples.


test2022_01_20_APSLHL_sumUp([18, -2, 2, -5]) → 20
test2022_01_20_APSLHL_sumUp([]) → 0
test2022_01_20_APSLHL_sumUp([-124, -346, -346, -235, -856, -41, -345, -22]) → 0

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

public int test2022_01_20_APSLHL_sumUp(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: 240

Copyright Nick Parlante 2017 - privacy