The solution is very simple.Traverse through the array and make the element in that index negative to mark it as unique.If a repeated element is encountered, check if it is negative and print it as a repeated element.Example: For input {1, 3, 2, 7, 5, 1, 3}, the output will be 1, 3.