Answer for coding challenge

This is my submission for the LivingSocial coding challenge.