I am getting wrong output
@Sadaf_khan0107,
https://ide.codingblocks.com/s/237156 corrected code.
Use double for loops to check inc and dec values.
inc[i] stores the length of the Longest Increasing subsequence ending with arr[i].
dec[i] stores the length of the longest Decreasing subsequence starting from arr[i]
For every element we are doing this.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.