So I\'m stuck at a competitive programming problem. I am exceeding the time by just a little bit and the only thing that consumes too much time is updating the solution arra