← Decode Ways
Discussions
Sign in to join the discussion.
Y
ybhat
OFFICIAL
1 month, 1 week ago
Why does my solution TLE on the last test case?
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 3 replies
D
deepikakap7
1 month, 2 weeks ago
Simple approach explained for beginners.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 1 reply
K
karthikcho3
2 months, 1 week ago
Asked in my Sprinklr OA last week.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 0 replies
A
aaravsingh
2 months, 1 week ago
Finally got AC after 3 WAs. Sharing what I missed.
Define dp[i] as the answer for the first i elements and write the transition from smaller states. Once it works, notice you only need the previous row/value, so space drops to O(1) or O(n).
💬 1 reply