← Amazon questions

Simulate betting game with doubling losses and reset wins

Filed under Amazon

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.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.