You are viewing a single comment's thread. Return to all comments →
public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n]; int count=0; for(int i=0;i<n;i++) { a[i]=sc.nextInt(); } for(int i=0;i<100;i++) { count=0; for(int j=0;j<n;j++) { if(a[j]==i) count++; }System.out.print(count+" "); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 1
You are viewing a single comment's thread. Return to all comments →