Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Kata {
- def parityBit(s: String): String =
- s.split(" ").map(x => if (x.count(_ == '1') % 2 == 0) x.dropRight(1) else "error").mkString(" ")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement