• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
December 30, 2023 |1.2K Views
PROBLEM OF THE DAY : 29/12/2023 | Check if a string is repetition of its substring of k-length
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 Strings 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: Check if a string is repetition of its substring of k-length
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp-compiler/5f95763a-8142-48e6-aaa7-8e163872881a