/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package programingtest; import java.util.Scanner; /** * * @author yh_04 */ public class Programingtest { /** * @param args the command line arguments */ public static void main(String[] args) { int[] count = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int[] correct = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; char[] s = new char[200010]; Scanner sc = new Scanner(System.in); s = sc.next().toCharArray(); for (int i = 0; s[i] != '\0'; i++) { count[s[i]]++; } int a = -1, b = -1; for (int i = 0; i < count.length; i++) { if (count[i] > correct[i]) { a = i; } else if (count[i] < correct[i]){ b = i; } } System.out.println(a + " " + b); } }