Can´t you achive the exact thing you are asking for by a simple counter?
If the counter is 1 then there are no duplicates. (false)
2 or more would imply duplicates. (true)
0 is of course not found in array. (error message?)
I guess you would want to reset counter to 0 at starting the function.