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

Java > Warmup-2 > noTriples
prev  |  next  |  chance

Given an array of ints, we'll say that a triple is a value appearing 3 times in a row in the array. Return true if the array does not contain any triples.

noTriples({1, 1, 2, 2, 1}) → true
noTriples({1, 1, 2, 2, 2, 1}) → false
noTriples({1, 1, 1, 2, 2, 2, 1}) → 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  >  Warmup-2

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

Copyright Nick Parlante 2006-10 - privacy