Compass Interview Question

one dp problem + one math problem