MAXPR - Editorial

@neweffort if you check the if condition you will find that whenever there is out of range the dp[i] = sum[a[i]-diff]+1, will not be executed. The pseudo code may not be exact. I guess that the editorialist was trying to make us understand the logic. So, better understand the logic.

no , this is not simplicity but carelessness in considering upper and lower bounds . Can confuse a lot of people and consumes more time during computation.

if (A[i] - diff >= 1 and A[i] - diff <= 100) is false then dp[i]=1