##
$newsecret = join '', map { ??? } split //, $secret;
####
my $newsecret = join '', map { my $char=$_; $_='' if exists $sec{$_}; $sec{$char}++} split //, $secret;
####
-----------------------------------
--the good, the bad and the physi--
-----------------------------------