Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This doesn't work for a lot of numbers, because you're checking AFTER the sort, for 459, which could've been 459,495,954,945,549, or 594 before the sort. your code gets the right answer when it was anything EXCEPT 495 before the sort.
For example, 247: 1: 742-247 = 495 the answer is 1. your code produces 2. In reply to Re: Re: (Golf) Kaprekar's Process
by sean
|
|