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

Java > Array-1 > double23
prev  |  next  |  chance

Given an int array, return true if the array contains 2 twice, or 3 twice. The array will be length 0, 1, or 2.

double23({2, 2}) → true
double23({3, 3}) → true
double23({2, 3}) → false

...Save, Compile, Run

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  Array-1

Forget It! -- delete my code for this problem 145.0

Copyright Nick Parlante 2006-10 - privacy