Certain letters of the alphabet are "lucky". The first "lucky" letter of the alphabet is "a", and every 2nd letter after a is also considered "lucky". In this way lucky letters include "a", "c", "e", "g" ... etc. The alphabet consists of the lowercase letters a-z.
A word is considered "lucky" if it contains at least 4 "lucky" characters e.g. "asks". Given an Array of N Strings (where each string contains a sentence) write a class which can print out the 2 "luckiest" sentences where "luck" is measured by the number of "lucky" words in the sentence. The goal is to write the most efficient algorithm, optimizing for both space and time. Briefly discuss the computational complexity of your solution.
Example: Input {"once upon a midnight dreary", "say aaaaah for the dentist", "lima is in peru", "three blind mice see how they run"} Output: once upon a midnight dreary say aaaaah for the dentist