How to solve APIO 2016 Boats? I couldn't find a detailed solution anywhere and I tried looking for similar problems to it but couldn't find detailed explanation. The question formally states to find the number of increasing subsequences of length n where each element Ai has constraint Li<=A[i]<=R[i]. the arrays L[i] and R[i] are given to you. n is upto 300.