We have an array with numbers ranging from 1...n, and every number appears once in that range, except one which appears twice. Write a method that finds the number that appears twice and returns that number.
For eg, given the array [1,2,3,4,4,5,6]
, return 4
.
Get the tests to pass.
View Find the Repeated Number on Learn.co and start learning to code for free.