Approach hintTry it first, then revealHide
A BFS over values, which never need to exceed about 2 * 10^4, finds the fewest presses. Alternatively work backwards from m: halve it when even, add one when odd, until it drops to n or below.
A BFS over values, which never need to exceed about 2 * 10^4, finds the fewest presses. Alternatively work backwards from m: halve it when even, add one when odd, until it drops to n or below.