Armstrong Numbers Alternative Average

3Easy

Armstrong Numbers Alternative Average

Given two integers, start and end, return a list of all Armstrong numbers in the range [start, end]. An Armstrong number (also known as a narcissistic number) for a given number of digits is an integer such that the sum of its own digits each raised to the power of the number of digits is equal to the number itself. For example, 153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153. \n\n###

Constraints:

\n- 1 <= start <= end <= 10^6\n\n### Example Test Cases:\n1. Input: start = 1, end = 1000 \n Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407] \n2. Input: start = 100, end = 500 \n Output: [153, 370, 371] \n3. Input: start = 400, end = 500 \n Output: []

JR

Jnaneshwara Reddy Satti

Builder · ClearCode

Hi — I'm a 21yo CS grad from India. I built ClearCode while recovering from a surgery, because I genuinely believe DSA should be visual, free, and accessible to everyone. No VC funding. No team. Just me, my laptop, and a lot of chai. ☕

If ClearCode helped you understand even one concept — consider supporting it. Every rupee keeps the servers running and new videos coming.

Support via Razorpay
Support ClearCode ☕