solution to age distribution https://www.codeeval.com/open_challenges/152/