Given a positive integer n as input, output the reversed range sum of n.
A reversed range sum is created by making an inclusive range up to n, starting with 1 and including n, reversing each of the numbers inside, and summing it.
Example:
Here is what would happen for an input of 10:
Range: [1,2,3,4,5,6,7,8,9,10]
Reverse: [1,2,3,4,5,6,7,8,9,01]
(1-char numbers reversed are themselves, 10 reversed is 01 or 1)
Sum: 46
Numbers with 3+ digits are reversed the same way numbers with 2 digits are. For example, 1234 would become 4321.
Test cases:
Input -> Output
10 -> 46
5 -> 15
21 -> 519
58 -> 2350
75 -> 3147
999 -> 454545
Complete text cases to input of 999 can be found here, thanks very much to @fireflame241.