Daily challenge for 2026-09-29
637. Magic Potion Mixing
You are adding ingredients (represented by integers) to a cauldron one by one. If the ingredient you are about to add is the exact opposite (sums to 0) of the most recently added ingredient still in the cauldron, they react and both vanish. Otherwise, the new ingredient is added to the cauldron. Return the sum of the ingredients remaining in the cauldron.
Example:Input: ingredients = [10, 20, -20, -10, 5]Output: 5
Run this challenge interactively in Python or JavaScript when the app loads.