what am i doing wrong

Question

ik the problem is supposed to be dp and im learning the basics of dp and chose this problem but after reading the question my mind went staright to this solution maybe its because i saw a similar solution to a contest problem recently

anyways this works in my head and even when i ask gpt to explain it says it wont work and then contradicts itself :(

Posted Sep 28, 2025, 1:35 PM UTC

10
Loading comments…