Problem Statement
How do Strategy and State differ in intent?
Explanation
Strategy lets you swap algorithms at runtime behind one interface. State changes behavior by switching internal state objects based on lifecycle.
The wiring is similar, but the trigger and semantics differ: choice vs lifecycle.
Code Solution
SolutionRead Only
price = pricingStrategy.apply(cart); state = state.next(event);
