You are viewing a single comment's thread. Return to all comments →
I used the properties of Maps.
object Solution { def functionTest() : Unit = { val X = scala.io.StdIn.readInt() val data = Iterator.continually(readLine()) .take(X) .collect(_.split(" ") match { case Array(s1, s2) => (s1.toDouble, s2.toDouble)}) .toList println(if (data.toMap.size == data.length) "YES" else "NO") } def main(args: Array[String]) { val N = scala.io.StdIn.readInt() for (_ <- 1 to N) { functionTest } } }
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 →
I used the properties of Maps.