auxiliary ( count ) array to store count . Initialize count array as 0. Size of count array will be equal to ( max + 1 ) .
$ t = $ max + 1 ; $ count [ $ t ] = array ( ) ; for ( $ i = 0 ; $ i < $ t ; $ i ++ ) $ count [ $ i ] = 0 ;