HackerEarth Solved Arranging Flowers