Google interview question

question on sliding pointer , maps and dp