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

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

Given an int array length 3, if there is a 2 in the array immediately followed by a 3, set the 3 element to 0. Return the changed array.

fix23({1, 2, 3}) → {1, 2, 0}
fix23({2, 3, 5}) → {2, 0, 5}
fix23({1, 2, 1}) → {1, 2, 1}

...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

New just for fun
 Random User Progress Graphs
 Random Epic Graphs 148.0

Copyright Nick Parlante 2006-11 - privacy