Google Cloud Interview Question

LC dynamic programming medium difficulty