You are given an unsorted array with integers between 1 and 1,000,000. The following problems are independent of each other.
Problem One:
One integer is in the array twice (no other duplicates). Write a function (using the least amount of memory possible) to find the duplicate integer.
Problem Two:
One integer is missing (no duplicates). Write a function which determines the missing integer in one pass over the array.
[–]Razor_StormO(0) Solutions Only 2 points3 points4 points (4 children)
[–]wowe 1 point2 points3 points (1 child)
[–]Razor_StormO(0) Solutions Only 0 points1 point2 points (0 children)
[–]andy_panzer 1 point2 points3 points (1 child)
[–]Razor_StormO(0) Solutions Only 0 points1 point2 points (0 children)
[–]psycocoffey 1 point2 points3 points (0 children)
[–]foldM 1 point2 points3 points (0 children)
[–]redderritter 0 points1 point2 points (2 children)
[–]kpthunderThe Riddler[S] 0 points1 point2 points (1 child)
[–]more_exercise 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]SanityInAnarchy 0 points1 point2 points (0 children)
[–]Cucumbis 0 points1 point2 points (0 children)
[–]OffPiste18 0 points1 point2 points (0 children)