DoorDash Interview Question

very similar to basic calculator II