import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); Stack stack = new Stack(); int no = 1;//출력할 때 number //TestCase가 안정해져있기에 while문으로 입력을 받..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class Main { public static int GoodLetter(String input) { Stack s = new Stack(); for(int i = 0; i < input.length(); i++) { char c = input.charAt(i); if(!s.empty()&&s.peek().equals(c)) { s.pop(); } else { s.add(c); } } if(s.isEmpty()) return 1; else return 0; } public static..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int[] arr = new int[N]; Stacks = new Stack(); String str = br.readLine(); for(int i = ..