How to solve this ques using Tries ?
https://practice.geeksforgeeks.org/problems/count-of-distinct-substrings/1
GeeksForGeeks : Ques of Tries
@aman_ishan hey the idea is to create trie of all sufixes of given string,once it is done our ans is the total no of nodes in constructed trie.
How does this work?
Each root to node path of a Trie represents a prefix of words present in Trie. Here we words are suffixes. So each node represents a prefix of suffixes.
Every substring of a string “str” is a prefix of a suffix of “str”.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.