//Note :-another approach use counting sort import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuffer sb=new StringBuffer(""); while(true) { int n=Integer.parseInt(br.readLine()); if(n<=0 || n>2000000) break; String s[]=br.readLine().split(" "); int ages[]=new int[n]; for (int i = 0; i
0 comments: