Modified Kaprekar Numbers
easy⏱ 15 mintypescriptchallengesproblem-solving-basic-
Sample case — your program reads stdin and prints to stdout.
A modified Kaprekar number n satisfies: square n, split the square into left part l and right part r (where r has exactly d digits, d = number of digits in n), then l + r = n. Find all such numbers in range [p, q].
Example: n=45 → square=2025 → split: l=20, r=25 (r has 2 digits, same as n) → 20+25=45 ✓. If no numbers found, output 'INVALID RANGE'.
Input format
Two integers p and q (p ≤ q), one per line.
Output format
Print all modified Kaprekar numbers in the range, space-separated, or 'INVALID RANGE' if none exist.
Constraints
0 < p < q < 100000