F. Consecutive Subsequence - Help

codeforces
dynamic-programming

#1

I am getting WA verdict on this problem and am unable to figure out why. It would be great if anyone can help me find that.
Here’s a link to my solution : Link
Thanks :slight_smile:


#2

I think you are compressing values in a wrong way. Suppose array A[]={2,6,9,10}. So you are mapping these non consecutive values to consecutive values as {1,2,3,4} which will give wrong answer.


#3

Yeah thank you…
Nice catch :wink: