You are given Map<Int, Int> as input. Return the sum of all values that have even keys.
Map
Sum of values
Report a typo
Sample Input 1:
{100 to 10}, {55 to 3}, {112 to 5}Sample Output 1:
15Sample Input 2:
{1 to 2}, {10 to 5}Sample Output 2:
5Write a program in Kotlin
fun summator(map: Map<Int, Int>): Int {
// put 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.