Implement a function that identifies and returns all "Eureka numbers" within a specified range. A Eureka number is defined as a number that is equal to the sum of its own digits raised to the power of their respective positions (1-based index).
Input/Output Requirements
Function Signature: def find_eureka_numbers(a: int, b: int) -> List[int]:
Inputs:
a (int): The starting integer of the range (inclusive).
b (int): The ending integer of the range (inclusive).
Output:
Returns a list of integers containing all Eureka numbers found in the range from a to b.
Implementation Details
Define a helper function within find_eureka_numbers named dig_pow(n: int) -> int that calculates the sum of its digits raised to the power of their respective positions.
Loop through all integers from a to b (inclusive) and apply the dig_pow function to each integer.
Check whether the integer is equal to its digit power sum.
Collect the Eureka numbers in a list and return this list.
File Location
The solution must be implemented in a file called /app/solution.py with the specified function signature and requirements.