Solve Two Grid Search Problems | Pinterest Interview Question