Okta Interview Question

They gave one dp problem and asked to solve