You have a Pair with string values. Write a function named revert that returns a new Pair as the reverse of the original.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Pair and Triple
Reverse of a Pair
Report a typo
Sample Input 1:
home carSample Output 1:
(car, home)Sample Input 2:
cat dogSample Output 2:
(dog, cat)Write a program in Kotlin
fun revert(pair: Pair<String, String>): Pair<String, String> {
// 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.