Challenge: Total Number of Words in a Trie

Try to solve Sort Values in a Stack problem.

We'll cover the following

Statement

Given a trie data structure that represents an array of words, words, determine the total number of words stored in it.

Constraints:

  • 00\leq words.length 103\leq 10^3

  • 1 1\leq words[i].length 45\leq45

  • All words[i] consist of lowercase English alphabets

Examples

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.