• + 0 comments

    Good Explanation

    But i have doubt..

    consider a logic where you add value to all elements from p to q

    after 1 5 3: 0 3 3 3 3 3 0 0 0 0 after 4 8 7: 0 3 3 3 10 10 10 10 10 0

    At this step, largest element is 10 But as per your logic largest element is 7

    can you explain please?