Hey, I solved the second problem(SFRV) of July_Lunchtime19 & can’t understand where I am getting wrong.

I haven’t solved it by DP as in editorial, but with simple arrays.

The problem link and solution has been attached.

Can anyone help me out ?

Problem SFRV @ltime77

My Solution