Another python one-liner


  • 0
    C
    def fizzBuzz(self, n):
        return [["Fizz",""][min(x%3,1)] + ["Buzz",""][min(x%5,1)] or str(x) for x in range(1,n+1)]

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.