Advertisement
TheRedRover

6 kyu Are they the "same"?

Jun 13th, 2020
1,136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.21 KB | None | 0 0
  1. object Solution {
  2.   def comp(seq1: Seq[Int], seq2: Seq[Int]) = (seq1, seq2) match {
  3.     case (null, _) => false
  4.     case (_, null) => false
  5.     case (s1, s2) => s1.map { x => x * x }.sorted  == s2.sorted
  6.   }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement