If next element is also same , then there are multiple occurrences , so print it
System . out . print ( arr [ i ] + " ▁ " ) ; } else if ( it != v . length ) System . out . print ( v [ it ] + " ▁ " ) ; else System . out . print ( - 1 + " ▁ " ) ; } }