Efficient Python Solution


#1

class Solution:

def fizzBuzz(self, A):
    final = []
    
    for i in range(1, A+1):
        
        val = "Fizz"*(i%3==0) + "Buzz"*(i%5==0)
        final += [val] if val else [i]
        
    return final