Pocket Gems Interview Question

two dynamic programing questions