Embercode
✕
Tries (C++)Quick quiz

Roots and longest word

8 questions. Covers Longest word built one letter at a time.

Questions 1 to 5 of 8

  1. 1. Using the replaceWords function from the roots lesson, this code runs: ``cpp std::cout << replaceWords({"ap", "apple"}, "apples banana applied apple") << '\n'; `` What does it print?
  2. 2. Using the solve function from the longest-word lesson, this code runs: ``cpp std::cout << solve({"t", "to", "too", "tool", "tools", "toolkit"}) << '\n'; `` What does it print?
  3. 3. In the longest-buildable search, why does dfs enter a child only when that child's is_end flag is set?
  4. 4. Roots ca and cat are stored in the trie, and the word is catalog. Which string does shortestRoot return?
  5. 5. The pile of words is yes, ye, y and yesterday. What is the answer to the longest-buildable search? Give the word without quotes.

    Type your answer.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.