diff --git "a/JHLEE325/202509/07 BOJ G5 A\354\231\200 B.md" "b/JHLEE325/202509/07 BOJ G5 A\354\231\200 B.md" new file mode 100644 index 00000000..cda2dbdd --- /dev/null +++ "b/JHLEE325/202509/07 BOJ G5 A\354\231\200 B.md" @@ -0,0 +1,33 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st; + String s = br.readLine(); + String t = br.readLine(); + + StringBuilder sb = new StringBuilder(); + sb.append(t); + + while (s.length() < sb.length()) { + char lastChar = sb.charAt(sb.length() - 1); + + sb.deleteCharAt(sb.length() - 1); + + if (lastChar == 'B') { + sb.reverse(); + } + } + + if (s.equals(sb.toString())) { + System.out.println(1); + } else { + System.out.println(0); + } + } +} + +```