Skip to content

Instantly share code, notes, and snippets.

@bky373
Created September 7, 2020 15:47
Show Gist options
  • Save bky373/d2a1a3a2a8888b29c039c1a30ec9c9ce to your computer and use it in GitHub Desktop.
Save bky373/d2a1a3a2a8888b29c039c1a30ec9c9ce to your computer and use it in GitHub Desktop.
class Solution {
fun solution(s: String): Boolean {
val chars = s.toCharArray()
return chars.all{ it.isDigit() } && (chars.size == 4 || chars.size == 6)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment