Simulate a betting game starting with an initial sum. Win: add bet to total, reset bet to 1. Loss: subtract bet from total, double bet. Given a sequence of W/L, return final sum or if funds run out.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.