Find all Armstrong numbers in a given range [start, end]. An Armstrong number equals the sum of its digits raised to the power of the number of digits.
Examples:
Input: 1, 1000 → Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 371, 407]
Input: 100, 200 → Output: [153]
Input: 1, 10 → Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]
Constraints:
- 1 ≤ start ≤ end ≤ 10^6
- Return results in ascending order
- Optimize for large ranges
153 = 1³ + 5³ + 3³ (3 digits, power 3)
Pre-calculate powers for efficiency
Group numbers by digit count for optimization
Expected Time
O((end-start) * log end)
Expected Space
O(result size)
Armstrong Numbers
Digit Manipulation
Range Query
Math