ISBIAS Help!

Problem link:Link

In the example, it says for the array 10,20,30,5… Maximal increasing Subsequence is L=1 and R=N… is 10,20,30… let’s take p as 20… this doesn’t satisfy the 2nd condition (p<p-1) … how is it a MIS? Please help. Having sleepless nights because of it

Bro you can not change your P i.e P is just starting index of your contiguous sub sequence.
Given array = [10, 20, 30, 5]. For L = 1 and R = 4,
if you take a contiguous sub sequence = [10, 20, 30] that means you decide your P = 1 and Q = 3.
Now as P = 1 and L = 1, no need to check second condition.
For Q = 3 and R = 4, third condition says if q < R it should satisfy A[q] > A[q+1] and 30 > 5

1 Like

Ohhhhhh… brooooooooooo you are such a legend brooooooooooo

1 Like