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

 

array_sumPossible


Given an integer array "arr", return true if it is possible to pick numbers from the array that add up to exactly 10. Example: The set {3,5,7} can add 3+7 to get exactly 10, while the set {2,5,7} does not have any way to sum numbers to get exactly 10. Note: You cannot use the same number more than once and you do not have to use every number in the array.


array_sumPossible([3, 5, 7]) → true
array_sumPossible([2, 5, 7]) → false
array_sumPossible([1, 8, 2, 7]) → true

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

public boolean array_sumPossible(int[] arr) { }

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