Advertisement
TheRedRover

Untitled

Apr 5th, 2020
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.22 KB | None | 0 0
  1. object ExesAndOhs {
  2.   def xo(str: String): Boolean = {
  3.     if (str.indexOf("o") == (-1) && str.indexOf("x") == (-1)) true
  4.     else if (str.toLowerCase().count(_ == 'o') == str.toLowerCase().count(_ == 'x')) true else false }
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement