StarLeaf interview question

Had to solve various programming challenges