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

 

norm.krumpe@muohio.edu > allSame
prev  |  next  |  chance

Recursively determine if all of the numbers in an array are equal. Note: You should solve this recursively (no loops). You will need a recursive helper method that takes an array and an index as parameters. Advice: If there are at least two items to look at, just look at the first two, and let recursion handle the rest.


allSame([4, 4, 4]) → true
allSame([3, 3, 3, 0]) → false
allSame([5]) → true

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

boolean 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: 300

Copyright Nick Parlante 2017 - privacy