about | help | code help+videos | done | prefs |
allSame
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 300
Copyright Nick Parlante 2017 - privacy