Infosys Interview Question

I was asked dp based questions.