@arr = ( ...as defined in the problem... ); %h = map { $_ => undef } @arr; print join(" , ",keys(%h)), "\n"';