diff --git a/LeetCode/0412_Fizz Buzz.py b/LeetCode/0412_Fizz Buzz.py new file mode 100644 index 0000000..fe6d00b --- /dev/null +++ b/LeetCode/0412_Fizz Buzz.py @@ -0,0 +1,4 @@ +class Solution(object): + def fizzBuzz(self, n): + return [str(i) * (i % 3 != 0 and i % 5 != 0) + "Fizz" * (i % 3 == 0) + "Buzz" * (i % 5 == 0) + for i in range(1, n + 1)]