leetcode.com

First exposure to Dynamic programming (opens in new tab)

Discussed on DEV

I tried solving Leetcode problem #10( Regular Expression Matching) for fun, ended up spending hours on it. problem Link: I took a naive greedy string construction approach to check if the string s matched the pattern p. That worked for simple cases where: p="a*b" s="aaab" output:True But failed in cases where p ="ab*a*c*a" and s ="aaa", output should be True why greedy string construction failed: the flaw was that a* is not a single choice, it can match "", "a", "aa", "aaa" etc. To determine ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help