Hint for problem

I couldn’t solve this problem : Find Strings | HackerRank
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: