백준 12904번 : A와 B
·
코테
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); StringBuilder t = new StringBuilder(br.readLine()); int n = 0; while (t.length() != 0 && n == 0) { if (t.lastIndexOf("A") == t.length() - 1) { t.deleteCharAt(t.lastIndexOf("A")); } else { t.deleteChar..