CCC '14 J2 - Vote Count
Source Code
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a = in.nextInt();
String b = in.next();
int count = 0;
for(int i = 0; i < a; i++){
if(b.charAt(i) == 'A'){
count++;
}
}
if(count > a - count){
System.out.println("A");
}else if(a - count > count){
System.out.println("B");
}else if((a - count) == count){
System.out.println("Tie");
}
}
}