I’m not sure why this question is categorized under Math instead of Dynamic Programming. I spent quite a long time with it not realizing that the solution requited a technique that hadn’t been introduced yet (I didn’t see that it was in a section called “Array dp” until later). Additionally, the solution approach is confusing to the point where I still was unable to solve the question, and the full implementation (in Java) doesn’t lend itself to readability (compute is not a good method name!). I think this question should either allow solving using the brute force recursive method, or be moved to the dynamic programming module.
Completely agree! I spent 5 hours trying to solve it and no luck. Moreover, I was thinking about the recursion method initially, but was confused by all the Hints and Solution approach, which referred to Dynamic Programming instead. Eventually, only 1 (!!!) complete solution for Python (out of 6 overall) used this technique - all others used recursion. And worth noting, that solutions themselves are really bad organized (with no comments at all and one-letter variable names), so even seeing those it takes a while to understand the approach. Also, the Solution approach hint has an error for Case 2.
I’ve already seen similar issue with using the technique that hadn’t been introduced yet on in the Arrays topic, where it was using the concept of Binary search, which is one level above. It is especially annoying, that these 2 cases are the only challenges in their blocks, so you can’t pick another challenge to complete this level in order to unlock those levels, where these concepts (DP, Binary search) are introduced. Hopefully Administration will fix these really annoying issues, cause it takes a lot of time and efforts to get through.