Is there a key?

Report a typo

The containsKeyAndValue function gets map: Map < String, String > and the string value: String as input parameters. If the map contains one or more keys that are equal to value and one or more values that are equal to value, the function returns true, otherwise it returns false.

Sample Input 1:

{one to two}, {three to one}, {four to five}
one

Sample Output 1:

true

Sample Input 2:

{10 to 20}, {30 to 1}, {55 to 23}
55

Sample Output 2:

false
Write a program in Kotlin
fun containsKeyAndValue(map: Map<String, String>, value: String): Boolean {
// put your code here
}
___

Create a free account to access the full topic