https://www.hackerrank.com/contests/w4/challenges/lucy-and-flowers