why do not you update the length of number in else part
(the last condition in the code)?
it should be …m[no]=len+1;
but in the code it just m[no]=len;
second question sir ,if the array contains duplicate like
{ 1,2,3,3,4}, then the length should be 4 (we just count one of the threes) or 5(count it)??