You're on the right lines, map is the right way to go. Rather than directly giving you the answer, I'd like to ask you to show us the code you tried so we can gain more insight into what you find confusing about map's documentation.
Update: Others have already answered your question, but it might be useful to see how and why you tried to use map to better understand how novices approach it. Also, it shows this isn't a "do my homework for me" question.
In reply to Re: map question
by tomhukins
in thread map question
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |