You are viewing a single comment's thread. Return to all comments →
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] arr = new int[100]; for (int i = 0; i < n; i++) { int val = scanner.nextInt(); String s = scanner.next(); arr[val]++; } int sum = 0; for (int i = 0; i < 100; i++) { sum += arr[i]; System.out.print(sum + " "); } scanner.close(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 3
You are viewing a single comment's thread. Return to all comments →