This question has two parts: Part 1 – Pattern Matching: Given a word (string of letters) and a pattern consisting of letters and '?' wildcards, where each '?' matches exactly one arbitrary letter, determine whether the word matches the pattern. The word and pattern must have the same length, and…