Problem 1387 · Medium
Memoize the steps each number needs to reach 1, then sort the range by that power and break ties by value.
Open the interactive visualisation