Datadog Interview Question

Implement a function that checks if a pattern matches a word