#292

Spell Checking Engine

MEDIUMString Processingpython

Problem Description

A log parsing pipeline uses pattern matching with wildcard characters to classify log lines against template patterns, enabling structured log analysis without full regex overhead. Implement a pattern matcher where `.` (dot) matches exactly one character (any character). Given a `word` and a `pattern`, return whether the word fully matches the pattern. **Input:** `word` (string), `pattern` (string with `.` wildcards). **Output:** `True` if the word matches the pattern, `False` otherwise. **Key Rules:** - `.` matches exactly one character (not zero, not more than one) - The entire word must match the entire pattern (full match, not substring) - Use dynamic programming for O(n × m) time

Topics

hash tablestring

Asked at Companies

meta

Solve This Problem

Sign up to access the interactive code editor, run test cases, view the editorial, and get AI-powered feedback on your solution.

Start Solving →