You are viewing a single comment's thread. Return to all comments →
My strange scala solution.
object Solution { def main(args: Array[String]) { val n = io.StdIn.readInt() (1 to n).foreach { i => val k = io.StdIn.readInt() val list = (1 to k).map(x => io.StdIn.readLine.split("\\s+")(0)).toList if (list.distinct.size == list.size) println("YES") else println("NO") } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Functions or Not?
You are viewing a single comment's thread. Return to all comments →
My strange scala solution.