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

 

jebbert@volusia.k12.fl.us > oct18_2016_SLHL_allSame
prev  |  next  |  chance

Write a method that returns 'true' if ALL of the numbers in the array are the same. However, if even one number does not match the others, return 'false'. Note that an empty array or an array with just one number in it will both be considered as matching so return 'true' in those cases.


oct18_2016_SLHL_allSame([]) → true
oct18_2016_SLHL_allSame([4, 5, 1, 8, 2, 17, 23, 50, 2, 2]) → false
oct18_2016_SLHL_allSame([7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) → true

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

public boolean oct18_2016_SLHL_allSame(int[] nums) { }

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

Difficulty: 290

Copyright Nick Parlante 2017 - privacy