Edited Find Repeating Number in Array algorithm