Visa Inc. interview question

He gave me one coding ques from Graph and DP.