SAP Interview Question

Fizz buzz question from leetcode