uva 10664 and hackrank flowers