DIY: Wildcard Matching

Solve the interview question "Wildcard Matching" in this lesson.

Problem statement

You will be given an input string s and a pattern p. You will have to implement wildcard pattern matching with support for ? and * where:

  • ? can match any single character.
  • * can match any sequence of characters. This sequence can be empty.

Please note that the matching must cover the entire input string.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.