Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Kotlin
/
Collections
How do you distinguish an absent key from a present key whose value is null?
from Collections
Kotlin 2.4.10
intermediate
1 min
How do you distinguish an absent key from a present key whose value is null?
Call map[key] twice.
Use map[key] together with containsKey(key).
Convert the map to a list first.
Use getValue(key), which returns null only for absence.
Check
Ask AI about this kata
Report an error
next kata
Which output is produced when the terminal operation runs?
Predict the output
A new version is available
Reload