EcecFind the repeated number in array size of n and all elements are from 1 to n with one element…Naive Solution:Jan 28, 2022Jan 28, 2022