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

 

norm.krumpe@muohio.edu arraywarmup > findTheDuplicate
prev  |  next  |  chance

Given an array, there is exactly one value that appears exactly two times. Return that value.


findTheDuplicate([1, 7, 1]) → 1
findTheDuplicate([5, 7, 5, 7, 8, 7]) → 5
findTheDuplicate([9, 9]) → 9

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

int findTheDuplicate(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