SAP interview question

They tested me on a leetcode algorithm question