Regular expression

Regular Expression Matching


hey can you please tell me where my code is wrong for the above question. i am providing link to my code

Hello @Dhruv-Miglani-2090236747707980,

For this problem, under bottom-up dp:

DP[i][j]=strong text

  1. if s[i]==p[j] && p[j]==’.’ :
    DP[i-1][j-1]

  2. if p[j]==’*’ :
    2.1. if s[i]==p[j-1] && p[j-1]==’.’ :
    DP[i-1][j]
    2.2. for zero occurrence:
    DP[i][j-2]

  3. else
    False

Hope, this would help.
Give a like if you are satisfied.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.