Why is it so? How can I correct that??
Few test cases showing wrong answer https://ide.codingblocks.com/s/109739
Hello @J19APPPP0007,
Read the following two points of the question, very carefully.
-
‘?’ – matches any single character
which means there must be only 1 character in place of ? -
‘*’ – Matches any sequence of characters (including the empty sequence)
which means there can be more than or equal to zero character in place of *
Your code is giving wrong outputs for testcases like:
ayghaba
a*a?a
Expected Output:
1
ayghaa
a*a?a
Expected Output:
0
aa
a?a
Expected Output:
0
aaaa
a?a
Expected Output:
0
Hope, this would help.
Give likes, if you are satisfied.