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

 

oddies


eliminate odd numbers in an array and replace them with the number 2, and if any odd numbers are greater than 100 replace it with the number 8


oddies([1, 4, 5, 6, 8, 10, 12]) → [2, 4, 2, 6, 8, 10, 12]
oddies([24, 20, 21, 18, 10, 8]) → [24, 20, 2, 18, 10, 8]
oddies([101, 100, 98, 92, 91]) → [8, 100, 98, 92, 2]

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

public int[] oddies(int[] 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