Find sum of all subarrays
for l in range ( n ) : NEW_LINE INDENT sum = 0 NEW_LINE for r in range ( l , n ) : NEW_LINE INDENT sum += a [ r ] NEW_LINE if ( l == r ) : NEW_LINE INDENT continue NEW_LINE DEDENT if ( sum <= n ) : NEW_LINE DEDENT DEDENT