title: Compare two lists in Python with o(n) complexity
body: <p>I have two lists and I want to find the keywords from the statements and if the statement has that particular keyword then I have to return that keyword.
  I am doing this in <code>o(n^2)</code>. Can I do this in <code>o(n)</code> or in some other lesser complexity? </p>
  
  <pre><code>keywords = ['name', 'class', 'school', 'address']
  
  statements = ['name is hello', 'name is not hello', 'school is hello', 'address is hello']
  
  for key in keywords :
      for statement in statements :
              string = statement
              if string.find(key) != -1:
              print(key)
  </code></pre>
  
  <p>We can increase the space complexity if we want to but I need to decrease the time complexity. I just need a logic through which I can achieve this. </p>