Jack and the gems

Problem Name:
Jack and the gems
Site:HackerEarth
Links:
Tags: