Edit solution for UVA 10420. Use TreeSet rathen than sorting a list.