Solve Manasa and Stones issue.
Which from hackerrank.
https://www.hackerrank.com/contests/w2/challenges/manasa-and-stones