Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because arr[i] still needs to be counted - which would not happen when the If statement fails. This is especially important in this challenge where the value you want to return may only appear once.
Since the array is sorted first, incrementing num in the else statement is the equivalent of saying "This is the last time this number appears in the array, let's see if it showed up an odd number of times."