Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tonybaines/e6ff7cb878eb632a93b870d3831e51ab to your computer and use it in GitHub Desktop.
Save tonybaines/e6ff7cb878eb632a93b870d3831e51ab to your computer and use it in GitHub Desktop.
val lowerBound = 100
val upperBound = 999
val Int.isPalindrome: Boolean
get() = this.toString() == this.toString().reversed()
println((lowerBound..upperBound).flatMap { x ->
(lowerBound..upperBound).map { y -> x * y }
.filter { it.isPalindrome }
}.max())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment