Skip to content

Instantly share code, notes, and snippets.

@1gravity
Last active September 14, 2022 17:07
Show Gist options
  • Save 1gravity/3c58d9709d22fa3c156255adbf7de9a3 to your computer and use it in GitHub Desktop.
Save 1gravity/3c58d9709d22fa3c156255adbf7de9a3 to your computer and use it in GitHub Desktop.
Kotlin Trie No Cleanup
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