 # Unofficial editorial of first 3 questions of DEC2016 long contest

Hello guys,

I have created a page https://www.facebook.com/algo0111/posts/142352516249980 where I have posted the explanation of the first 3 problems of the DEC2016 contest. I didn’t manage to do the others. If I succeed I’ll post their explanation too Feel free to like my page, to receive updates on it Thanks

Regards,
Rohit

I felt that your example for the editorial of KIRLAB was wrong or I may have misunderstood it. Let’s try your method with the given test case.
13 2 8 6 3 1 9
here dp=1, dp=3 and dp=3. If the answer is max(dp[i]) then the answer should have been 3 whereas the answer is 5.Please comment on this @codedecode0111. Forgive me if I may have misunderstood it. Hello @tej_17: We check the elements sequentially, so first element we check is 13, then 2, 8 and so on…
So, initially, dp[i] = 0 for all i.

```Case 13:
dp = 0, so we update dp = 1

Case 2:
dp = 0, so we update dp = 1

Case 8:
dp = 1, so we update dp = 2

Case 6:
dp = 2, dp =1, max = 2, so we update dp = dp =2 +1  = 3

Case 3:
dp = 3, so we update dp = 4

Case 1 :
We skip.

Case 9:
dp = 4, so we update dp = 5.
```

Max(dp[i] for all i) is 5 which is the required answer.

Thanks for clearing the confusion @codedecode0111

No problem Why my solution is giving TLE for second subtask?