Given an array $$$A$$$ of length $$$N$$$ with positive elements $$$a_1, a_2,...,a_N$$$ and two numbers $$$L$$$ and $$$R$$$. Divide the array into minimum number of sub-arrays such that each subarray have sum in the range $$$[L, R]$$$.
I thought of two pointers approach but I am sure how to take care of the lower bound of $$$L$$$ on subarray sum. How should we approach this problem?