Hint for problem

I couldn’t solve this problem : https://www.hackerrank.com/challenges/find-strings
I have submitted it by using suffix tries of all words , but actually i got Memory limit. How to solve this ?
Thank you :slight_smile:

//