WHOOPS! I am wrong! And that code is fatally flawed!
Change the array to
and it gives the answer
Reason: After sorting the array and converting it to a string, you get:
This number 2 appears 3 times
And, as I mentioned, when it sees ",2" it looks for repetitions and indeed FALSELY finds 3:
Okay...here's a small challenge: Fix that code!
HINT: The fix is nearly trivial.