Help this newbie solve an easy problem

Revision en2, by StellarSpecter, 2024-09-09 05:03:36

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

Spoiler

gholyo attractors 1.618034 123gjweq2

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)