Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Simulate the process step by step. At each step, drink <code>numExchange</code> bottles of water then exchange them for a full bottle. Keep repeating this step until you cannot exchange bottles anymore.
Solve with full IDE support and test cases