about | help | code help+videos | done | prefs |
countArrayPairs
Given an array, count the number of times that a number in the array matches the number in the next location in the array. Note: You should solve this recursively (no loops). You will need a recursive helper method that takes an array and an index as parameters. countArrayPairs([2, 2, 3, 4, 5, 5]) → 2 countArrayPairs([5, 5, 5, 5]) → 3 countArrayPairs([1, 0]) → 0 ...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