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


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

sub k { $_="000"|"@{[pop]}";/495/?0:1+k(-($_=join('',sort/./g)+reverse) }
62

--sean