Help this newbie solve an easy problem

Revision en1, by StellarSpecter, 2024-09-09 04:59:14

Problem: Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:

'.' Matches any single character.​​​​

'*' Matches zero or more of the preceding element.

The matching should cover the entire input string (not partial).

Can anyone help me with this ?

i tried two pointers and it failed, then I looked at the solution. It was DP but I could not get the idea on how to think and understand that, Can anyone explain in easiest words to me please ?

Thanks

Tags thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English StellarSpecter 2024-09-09 05:03:36 199
en1 English StellarSpecter 2024-09-09 04:59:14 591 Initial revision (published)