Files

30 lines
801 B
Java
Raw Permalink Normal View History

2017-03-24 00:02:30 -05:00
// Author: Rodney Shaghoulian
2018-07-27 16:45:56 -07:00
// Github: github.com/RodneyShag
// HackerRank: hackerrank.com/RodneyShag
2017-03-24 00:02:30 -05:00
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
final int maxValue = 100;
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] array = new int[maxValue];
/* Save into buckets */
for (int i = 0; i < n; i++) {
int num = scan.nextInt();
scan.next(); // don't need the String
array[num]++;
}
scan.close();
/* Print "L" for each bucket */
int count = 0;
for (int i = 0; i < array.length; i++) {
count += array[i];
System.out.print(count + " ");
}
}
}