I am trying to solve a problem where i have given a text file with words followed by newline charecter
I need to write a function which takes input as a string and should return output true if it is a meaningful word else false.
My attempt of doing it is to traverse through the text file and maintain a hash for the words . If my given input is a word which exists in the hash i would return true else false.but hash has a space complexity of O(n) how else can we achieve this.
Please help me with the solution.