Detect Repeating Element - Coding problem | OneNoughtOne