Complete the code to create an immutable map with two entries.
val colors = [1]("red" to "#FF0000", "green" to "#00FF00")
Use mapOf to create an immutable map in Kotlin.
Complete the code to create a mutable map and add a new entry.
val fruits = [1]("apple" to 1, "banana" to 2) fruits["orange"] = 3
mutableMapOf creates a map that can be changed after creation.
Fix the error in the code by choosing the correct function to create a mutable map.
val scores = [1]("Alice" to 10, "Bob" to 8) scores["Charlie"] = 7
Only mutableMapOf allows adding new entries after creation.
Fill both blanks to create a map of squares for numbers greater than 3.
val squares = (1..5).filter { it [2] 3 }.associate { it to it [1] it }
Use * for multiplication and > to filter numbers greater than 3.
Fill all three blanks to create a mutable map with uppercase keys and values greater than 0.
val result = data.entries.filter { (_, v) -> v [3] 0 }.associate { (k, v) -> [1] to [2] }.toMutableMap()Use k.uppercase() for uppercase keys, keep values as v, and filter values greater than 0 with >.
