Liquid in a Soda Machine
You are given an array of integers representing a range of requested soda in ml (milliliters). The soda machine has three buttons on it. Pressing the first button will dispense between
205ml of soda. Pressing the second button dispenses between
305ml. Pressing the third button dispenses between
400ml and 405ml.
solve function will be called with a desired milliliters of soda as an integer. Return true if the soda machine can dispense the given amount, false if not.
- Must return either true or false
solve(605) > true
The target is 605 milliliters. This could be achieved by pressing the first button three times, or by pressing the second button twice
solve(100) > false
The target is 100 milliliters. There aren't any combination of buttons we could press to dispense 100ml, so return false