0397. Integer Replacement
Description
**Input:** n = 8
**Output:** 3
**Explanation:** 8 -> 4 -> 2 -> 1**Input:** n = 7
**Output:** 4
**Explanation:** 7 -> 8 -> 4 -> 2 -> 1
or 7 -> 6 -> 3 -> 2 -> 1**Input:** n = 4
**Output:** 2ac
Last updated