Find the occurence of each number from array in O(n) ?

Find the the occurrence of each number from given array of size n , where elements ranges from 0 to n-1 ?
Complexity : O(n)
Space complexity : O(1)
e.g.
Input:
5 3 3 2 1 3 8 7 3
Output:
3 occurs 4 times

Solution :

Code provided by : Arpit Agrawal