Simplest solution without using mod operation

interview-questions
Tags: #<Tag:0x00007f2427e803d0>

#1

def fizzBuzz(self, A):
c5=0
c3=0
d=""
res=[]
for i in range(1,A+1):
c5+=1
c3+=1

        if c3==3:
            d=d+"Fizz"
            c3=0
        if c5==5:
            d=d+"Buzz"
            c5=0
        if d=="":
            res.append(i)
        else:
            res.append(d)
            d=""
    
    
    return res