Sum of components

Report a typo

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.

Sample Input 1:

1 2 3

Sample Output 1:

6

Sample Input 2:

0 -1 1

Sample Output 2:

0
Write a program in Kotlin
fun sum(triple: Triple<Int, Int, Int>): Int {
// write your code here
}
___

Create a free account to access the full topic