| 36 | } |
| 37 | |
| 38 | fun hasPrefix(prefix: String): Boolean { |
| 39 | var node = root |
| 40 | for (c in prefix.toCharArray()) { |
| 41 | if (c !in node.children) { |
| 42 | return false |
| 43 | } |
| 44 | node = node.children[c]!! |
| 45 | } |
| 46 | // Once we've traversed the nodes corresponding to each |
| 47 | // character in the prefix, return True. |
| 48 | return true |
| 49 | } |
| 50 | } |
nothing calls this directly
no outgoing calls
no test coverage detected