import java.util.*;
class SortDuplicateElement{
public static void main(String args[]){
int my_arr[]={10,10,10,20,20,30,40,50,60,70};
System.out.println("length of updated array is : "+sort_array(my_arr));
}
public static int sort_array(int arr[]){
int index=1;
for(int i=0;i<arr.length;i++){
if(arr[i]!=arr[index-1]){
arr[index++]=arr[i];
}
}
return index;
}
}