BMW Group Interview Question

A simple algorithm question which I don't remember