Tested just now:<p>Q: In kotlin, how would you implement a function that takes a string and returns boolean true iff the string is palindromic, otherwise false?<p>A:<p>> Here is an example implementation of a palindrome checking function in Kotlin:<p><pre><code> kotlin
fun isPalindrome(s: String): Boolean {
val cleaned = s.filter { it.isLetterOrDigit() }.toLowerCase()
return cleaned == cleaned.reversed()
}
</code></pre>
> This implementation first removes any non-letter and non-digit characters and converts the string to lowercase. Then, it checks if the cleaned string is equal to its reversed form. If they are equal, the function returns true, otherwise false.<p>Bonus test of the 'new mathematical ability and accuracy' claimed in the modal intro on login:<p>Q: what's 16 times 9 times 5 times 7?<p>A: The expression 16 * 9 * 5 * 7 evaluates to 7560.<p>Oops!