STRING WINDOW CPP

In this question how would i take input with the string with spaces? And how to insert the space into the trie

@Kush_1312 for taking input you can use getline(cin, str)
Space is just a character, you can use it as same.

could you please also tell me how can i display a element in trie

@Kush_1312 you can start from root node and keep visiting the neighbours recursively till the node is terminal or end node

I thought in this question to display the elements till the last word of string 2 is encountred. So how is it possible to. display the element while traversing?

@Kush_1312 If you want to print something in trie then you can just keep traversing through it and either print the characters at same time or store them in any data structure and print at last.

It would be very grateful if you could provide me with the code for the same

@Kush_1312 actually i don’t have any practical approach in my mind where you can do this question using trie.
according to me it can be done using Sliding window technique.

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.