Help this newbie solve an easy problem

Правка en2, от 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

Теги thanks

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский StellarSpecter 2024-09-09 05:03:36 199
en1 Английский StellarSpecter 2024-09-09 04:59:14 591 Initial revision (published)