BST Gem Stones from HackerRank.