Write a function named isReversed with a Pair parameter with two words, which returns a Triple with the two given words and the word "true" if second word is reversed first or "false" if it is not. The function should be case-insensitive
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Pair and Triple
Is a reversed word
Report a typo
Sample Input 1:
cat dogSample Output 1:
(cat, dog, false)Sample Input 2:
Otto ottoSample Output 2:
(Otto, otto, true)Write a program in Kotlin
fun isReversed(pair: Pair<String, String>): Triple<String, String, Boolean> {
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.