Help with debugging

prob: https://leetcode.com/problems/subarray-product-less-than-k/

code: https://ide.codingblocks.com/s/388080

I have debugged the code and saved it but the answer still isn’t correct


It is working now but I wanted to know why can’t there be any subarrays when k = 1.
For k = 0 it is understandable that the answer will be 0

It’s cause because the apporach we are following is to find the product of subarray less then value of K, so less then 1 is also 0. In this case what we are doing is returning 0.
Hope this will clear your doubt :slight_smile: