Last active
September 14, 2022 17:07
-
-
Save 1gravity/3c58d9709d22fa3c156255adbf7de9a3 to your computer and use it in GitHub Desktop.
Kotlin Trie No Cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun delete(key: String) { | |
key.fold(root) { node, char -> | |
node.children[char] ?: return | |
}.value = null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment