You are given the Triple<Int,Int, Int> as input. Write a function named sum() that receive a Triple and returns the sum of its components.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Pair and Triple
Sum of components
Report a typo
Sample Input 1:
1 2 3Sample Output 1:
6Sample Input 2:
0 -1 1Sample Output 2:
0Write a program in Kotlin
fun sum(triple: Triple<Int, Int, Int>): Int {
// 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.