@@ -0,0 +1,996 @@
+// https://codeforces.com/problemset/problem/37/A%0A%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Scanner;%0Aimport java.util.Set;%0A%0Apublic class Solution %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%09%09%0A%09%09int n = read.nextInt();%0A%09%09%0A%09%09int%5B%5D l = new int%5Bn%5D;%0A%09%09Set%3CInteger%3E uniqueBarLengths = new HashSet%3C%3E();%0A%09%09Map%3CInteger, Integer%3E barLengthFrequencies = new HashMap%3C%3E();%0A%09%09int maxTowerSize = 0;%0A%09%09%0A%09%09for (int i = 0; i %3C n; ++i) %7B%0A%09%09%09l%5Bi%5D = read.nextInt();%0A%09%09%09uniqueBarLengths.add(l%5Bi%5D);%0A%09%09%09Integer barLengthFrequency = barLengthFrequencies.get(l%5Bi%5D);%0A%09%09%09if (barLengthFrequency == null) %7B%0A%09%09%09%09barLengthFrequencies.put(l%5Bi%5D, 1);%0A%09%09%09%7D%0A%09%09%09else %7B%0A%09%09%09%09barLengthFrequencies.put(l%5Bi%5D, barLengthFrequency+1);%0A%09%09%09%7D%0A%09%09%09maxTowerSize = Math.max(maxTowerSize, barLengthFrequencies.get(l%5Bi%5D));%0A%09%09%7D%0A%09%09%0A%09%09System.out.println( %0A%09%09%09maxTowerSize%0A%09%09%09+ %22 %22 + %0A%09%09%09uniqueBarLengths.size() %0A%09%09);%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%0A%7D%0A

Create Towers.java