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

 

foundPair


Given an array of integers, recursively determine whether there are at least two adjacent numbers that 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 check the first two, and let recursion handle the rest.


foundPair([5, 2, 2, 4]) → true
foundPair([2, 5, 2]) → false
foundPair([0, 0, 17, 2, 99]) → true

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

boolean foundPair(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