Skip to content

Instantly share code, notes, and snippets.

@hansrajdas
Created October 27, 2018 19:14
Show Gist options
  • Save hansrajdas/bc21f1631c520a559c3711d52ef30187 to your computer and use it in GitHub Desktop.
Save hansrajdas/bc21f1631c520a559c3711d52ef30187 to your computer and use it in GitHub Desktop.
def requiredAmountAtStart(netSaving):
initial_money = 0
net = 0
for e in netSaving:
net += e
if net <= 0:
initial_money += 1 + (-1 * net)
net += 1 + (-1 * net)
return initial_money
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment