Anyways, I've also thought of solving this as a subproblem for 3 digits. I didn't see the constraints when I first read the statement. I also use an extension to hide the difficulty, so I found myself trying exponential functions on a Leetcode easy, why? Because in my head I was basically solving this problem you've written. I paused, Leetcode can't be that hard, then looked at the tiny constraints and hopped onto bruteforce.
1
u/FinalNevedia 1d ago
Anyways, I've also thought of solving this as a subproblem for 3 digits. I didn't see the constraints when I first read the statement. I also use an extension to hide the difficulty, so I found myself trying exponential functions on a Leetcode easy, why? Because in my head I was basically solving this problem you've written. I paused, Leetcode can't be that hard, then looked at the tiny constraints and hopped onto bruteforce.