docs: public TrieNode matchEnd(String search) {
      if (search.isEmpty()) return root();
      int min = 0;
      int max = search.length();
      int i = Math.min(max, 12);
      int winner = -1;
      while (max > min) {
        String attempt = search.substring(search.length() - i);
        TrieNode cursor = traverse(attempt);
        if (cursor.getString().equals(attempt)) {
          min = Math.max(min, i + 1);
          winner = Math.max(winner, i);
        }
        else {
          max = Math.min(max, i - 1);
        }
        i = (3 * max + min) / 4;
      }
      if (winner < 0) return root();
      String matched = search.substring(search.length() - winner);
      return traverse(matched);
    }