http://www.perlmonks.org?node_id=89111


in reply to Re: Re: Re: (Golf) Kaprekar's Process
in thread (Golf) Kaprekar's Process

Yeah, i realized the whole @{[pop]} bit wasn't needed about 20 miles from home, figured someone would've already noticed it by the time i got back.. Here's one more:
sub k { $_=0 x3|"@_";/495/?0:1+k(-($_=join'',sort/./g)+reverse) }
55

--sean