Traversing over string considering each position and finding bounds and count using the inequalities
for k in range ( n ) : NEW_LINE INDENT j = 1 NEW_LINE while ( j <= ( n // x ) and prefix_sum [ k ] + j <= cnt ) : NEW_LINE DEDENT