Loop to find the count of the K sized subarrays possible with elements less than mid
for j in range ( l ) : NEW_LINE INDENT if ( arr [ j ] > mid ) : NEW_LINE INDENT cnt = 0 NEW_LINE DEDENT else : NEW_LINE INDENT cnt += 1 NEW_LINE if ( cnt >= k ) : NEW_LINE INDENT product += 1 NEW_LINE cnt = 0 NEW_LINE DEDENT DEDENT DEDENT