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

 

tmhscs@gmail.com streams > logic_blackJackN
prev  |  next  |  chance

Given an integer array of size N, return the integer value that is nearest to 21 without going over. Return 0 if every element in the array is over 21.


logic_blackJackN([5, 10, 15, 20, 25]) → 20
logic_blackJackN([10, 20, 15, 10, 20]) → 20
logic_blackJackN([5, 21, 5, 3, 20]) → 21

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

public int logic_blackJackN(int[] list) { }

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