Sort:  

You can post what you have. @deemarshall post it also, but has two little mistake in the solution.