|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re: Re: (Golf) Kaprekar's Processby sean (Beadle) |
| on Jun 17, 2001 at 17:38 UTC ( [id://89179]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
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 Section
Meditations
|
|
||||||||||||||||||||||||||||