⚙️AlgorithmIntermediate
Exchange Arguments in DP
An exchange argument proves that any optimal solution can be reordered to satisfy a simple sorting rule by showing that swapping adjacent out-of-order elements never helps.
#exchange argument#adjacent swap#smith rule+12