• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
December 29, 2023 |1.2K Views
PROBLEM OF THE DAY : 28/12/2023 | Wildcard string matching
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Matrix but also build up problem-solving skills.

In this problem, we are given two strings wild and pattern. Determine if the given two strings can be matched given that, wild string may contain * and ? but string pattern will not. * and ? can be converted to another character according to the following rules:

* --> This character in string wild can be replaced by any sequence of characters, it can also be replaced by an empty string. ? --> This character in string wild can be replaced by any one character.

Example :

Input: 
wild = ge*ks
pattern = geeks Output: Yes Explanation: Replace the '*' in the wild string with 'e' to obtain pattern "geeks"

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/wildcard-string-matching1126/1
Solution IDE Link:https://ide.geeksforgeeks.org/online-cpp-compiler/f0d28e5f-f2e2-437e-bf1d-2d1a0edccf7d