Anheuser-Busch InBev interview question

Aptitude question,lr di, code oytput