You are given two integers L and R. Your task is to print all Perfect numbers in the inclusive range [L, R] in ascending order, separated by spaces. A Perfect number equals the sum of all its positive proper divisors, excluding itself.
Input: L = 1, R = 100
Output: 6 28
Explanation: The Perfect numbers in the range from 1 to 100 are 6 and 28.
Input: L = 1, R = 1000
Output: 6 28 496
Explanation: The Perfect numbers in the range from 1 to 1000 are 6, 28, and 496.
Input: L = 10, R = 20
Output: (empty)
Explanation: There are no Perfect numbers in this range, so there are no numbers to print.
Sign in to write, run, and submit your solution against the full test suite.