# Task completed: Once the quadratic solution works, refactor to store patterns in hash table with pattern length as key.