OK... Greg has just introduced me to some "Normal etiquette" (and also
to the "International" perl golf counting method)...

I apologize for not having submited my solution so far; the only reason
why I didn't do it was because I thought you might want to give it a try
without being influenced.

Here it goes:

#!/usr/bin/perl -l0n
/:/;$_{$'.$&}.=" $`,"}{map{s/,$/
/;print}%_

:-)

jac

On Mon, 2004-04-26 at 15:54, Jose Alves de Castro wrote:
> Try to do this in the least amount of characters possible :-)
> 
> Sample Input:
> 
> root:admins
> administrator:admins
> me:users
> 
> Output:
> 
> admins: root, administrator
> users: me
> 
> My current solution is now on 65 bytes (that's the size of the whole
> script), but I guess more experienced golfers than me will probably
> manage to do something smaller... :-)
> 
> Happy hacking ;-)
> 
> jac
-- 
Josà Alves de Castro <[EMAIL PROTECTED]>
Telbit - Tecnologias de InformaÃÃo

Reply via email to