3 ms·
It seems to go for the "least interesting" result. eg: I gave it 363 and it gave me back 363 + 0 + 0, which while technically true, 121 + 121 + 121 would have b
by brk 8y ago
It seems to go for the "least interesting" result. eg: I gave it 363 and it gave me back 363 + 0 + 0, which while technically true, 121 + 121 + 121 would have been more in the spirit of it, IMO. Or even 242 + 121 + 0 would be a little easier than just reusing the original palindrome number with zeros.
- tim1994 8y agoWell it proofs the existence and there are many special cases they consider. If the number is a palindrome already there are many possible solutions. Using zeros is a trivial an the simplest solution. Using anything else would be abitrary and longer too.
- theoh 8y agoIt's handy that the "empty sum " (zero) happens to be a palindrome, so it can just work to fill any number of empty slots.