Stores the prefix sum array
pref = [ 0 for i in range ( n ) ] NEW_LINE sum = 0 NEW_LINE for i in range ( n ) : NEW_LINE INDENT sum += nums [ i ] NEW_LINE pref [ i ] = sum NEW_LINE DEDENT cnt = 0 NEW_LINE