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

 

frew@mclean.com > sumNegatives
prev  |  next  |  chance

Add up all of the negative numbers in the given array.


sumNegatives([2, 10, -3, 4, -20, 5]) → -23
sumNegatives([-10, 1, 40, 2]) → -10
sumNegatives([10, 1, -90, -20]) → -110

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

public int sumNegatives(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: 250

Copyright Nick Parlante 2017 - privacy