Reverse of a Pair

Report a typo

You have a Pair with string values. Write a function named revert that returns a new Pair as the reverse of the original.

Sample Input 1:

home car

Sample Output 1:

(car, home)

Sample Input 2:

cat dog

Sample Output 2:

(dog, cat)
Write a program in Kotlin
fun revert(pair: Pair<String, String>): Pair<String, String> {
// write your code here
}
___

Create a free account to access the full topic