They both work. They just do different things. Remember that the return value of a block is the return value of the last command executed. So in the first one you remove the hyphens first and then split on white space... returning the substrings from the splits. The second version splits on white space, passing the sub strings to the left map which then removes the hyphens
which is then passed to the join.