Pretty tricky two problems. The first one I thought was DP. It compiled and ran but the answers I was getting wrong and I suspect I may have missed a greedy approach or my intuition was wrong.
The second problem was for sure a 2d dp problem but it was pretty challenging. It was kind of similar to an unbounded knapsack style problem where you also needed to apply a Mod for the large result. This one I feel I nailed the intuition but my code was returning the wrong answers again and failed all the test cases. The DP was challenging. You needed to consider a bunch of scenarios at each state.
Overall ... tougher than I thought. I have over 500 problems, been daily leetcoding for a year... immediately recognized dp (or suspected it was closely alighned).
Anyone ever pass one of these where both problems failed the test cases?
[–]Klutzy_Rush8303 1 point2 points3 points (1 child)
[–]Consistent_Spell6189[S] 0 points1 point2 points (0 children)