You are viewing a single comment's thread. Return to all comments →
There is no need to have a separate check for singleton lists.
total = sum(arr)
so_far = 0
for i in arr:
if total - i == 2*so_far:
so_far += i
How did you thought such an Amazing idea.
I have uploaded a video tutorial which can help you to how he came up with this idea.
Guys do visit his channel once there is no harm that. The beauty is that he has soved question in very good way and they are easier to underastand.