7 kyu

Find The Duplicated Number in a Consecutive Unsorted List

1,878 of 9,555jdwolford

Description:

You are given an array of n+1 integers 1 through n. In addition there is a single duplicate integer.

The array is unsorted.

An example valid array would be [3, 2, 5, 1, 3, 4]. It has the integers 1 through 5 and 3 is duplicated. [1, 2, 4, 5, 5] would not be valid as it is missing 3.

You should return the duplicate value as a single integer.

Arrays
Algorithms

Stats:

CreatedJun 26, 2015
PublishedJun 26, 2015
Warriors Trained11435
Total Skips139
Total Code Submissions21087
Total Times Completed9555
JavaScript Completions7026
Ruby Completions377
Python Completions1878
C# Completions345
R Completions99
CoffeeScript Completions8
Scala Completions16
Total Stars58
% of votes with a positive feedback rating92% of 977
Total "Very Satisfied" Votes844
Total "Somewhat Satisfied" Votes115
Total "Not Satisfied" Votes18
Ad
Contributors
  • jdwolford Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • Souzooka Avatar
  • mentalplex Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad