Algorithm for Raindrop Game