Last active
April 16, 2019 15:13
-
-
Save tonybaines/e6ff7cb878eb632a93b870d3831e51ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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