```
#WindowEnd works out of for loop because of loop_variable leakage in Python
def equal_subset(num):
windowStart = 0
_sum = 0
half = sum(num)/2
for windowEnd in range(len(num)):
_sum += num[windowEnd]
do_break = False
while _sum > half
_sum -= num[windowStart]
windowStart += 1
if _sum == half:
do_break = True
break
if do_break:break
first_set = sum(num[windowStart:windowEnd+1])
second_set = sum(num[0:windowStart] + num[windowEnd+1:])
if not first_set == second_set:
return False
return True
```

## I have a solution with O(N) Time complexity and O(1) space Complexity

Type your question above this line.

Course: https://www.educative.io/collection/5668639101419520/5633779737559040

Lesson: https://www.educative.io/collection/page/5668639101419520/5633779737559040/5752754626625536