All Posts

1276 articles

dsa1 min read

Word Break — Reachability DP

Check if string can be segmented into dictionary words. DP: dp[i]=true if some dp[j] is true and s[j:i] is in wordDict.

Read →
dsa1 min read

Russian Doll Envelopes — 2D LIS

Maximum envelopes you can nest. Sort by width ascending and height descending, then LIS on heights. Descending heights prevents using same-width twice.

Read →
Page 37 of 256