Google Code Jam Practice Excercise A