Capchase Interview Question

write an O(N) keyword matching algorithm