SAP interview question

An algorithm code challenge