Solution to Flowers on HackerRank

My solution to prolem:
https://www.hackerrank.com/challenges/flowers