And initialize arr [ i ] as 0 means the element ' i + 1' is not seen so far
arr [ i ] = 0 ; i ++ ; } } System . out . println ( " Below ▁ are ▁ counts ▁ of ▁ all ▁ elements " ) ; for ( int j = 0 ; j < n ; j ++ ) System . out . println ( j + 1 + " - > " + Math . abs ( arr [ j ] ) ) ; }