code: public void add(String input) {
          TrieNode currentNode = root;
  
          for(char c: input.toCharArray()) {
              Map<Character, TrieNode> children = currentNode.getChildren();
              TrieNode matchingNode = children.get(c);
              if(matchingNode != null) {
                  currentNode = matchingNode;
              } else {
                  TrieNode newNode = new TrieNode();
                  children.put(c, newNode);
                  currentNode = newNode;
              }
          }
          currentNode.end=true; // this is the end of an input that was added, there may be more children
      }
docs: Add a string to the trie.
  @param input any String