A - Similar String Editorial by cirno3153


0oに、1lに置き換えると、 \(S\)\(T\) が同じ文字列か判定する問題になります。

fun main() {
  val N = readLine()!!
  val S = readLine()!!.replace("0", "o").replace("1", "l")
  val T = readLine()!!.replace("0", "o").replace("1", "l")
  println(if (S == T) "Yes" else "No")
}

posted:
last update: