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

 

tmhscs@gmail.com arrays > array_onlyOneTrue
prev  |  next  |  chance

Given a boolean array named "arr", return true if there is only one value of true in the array and false if there are multiple values of true or no values of true in the array.


array_onlyOneTrue([]) → false
array_onlyOneTrue([true]) → true
array_onlyOneTrue([true, true]) → false

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

public boolean array_onlyOneTrue(boolean[] 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