Fizz Buzz Multithreaded — LeetCode 1195 Python Solution
MediumConcurrency
- Problem
- #1195
- Reading time
- 2 min
- Source
- leetcode.com
The problem
You have the four functions: printFizz that prints the word "fizz" to the console, printBuzz that prints the word "buzz" to the console, printFizzBuzz that prints the word "fizzbuzz" to the console, and printNumber that prints a given integer to the console. You are given an instance of the class FizzBuzz that has four functions: fizz, buzz, fizzbuzz and number.
Example
- Input
- n = 15
- Output
- [1,2,"fizz",4,"buzz","fizz",7,8,"fizz","buzz",11,"fizz",13,14,"fizzbuzz"]
Complexity
| Measure | Complexity |
|---|---|
| Time | O(n) |
| Space | O(1) to O(n) auxiliary |
Related problems
Frequently asked questions
- How hard is LeetCode 1195. Fizz Buzz Multithreaded?
- LeetCode 1195. Fizz Buzz Multithreaded is rated Medium on LeetCode.
- What topics does LeetCode 1195. Fizz Buzz Multithreaded cover?
- LeetCode 1195. Fizz Buzz Multithreaded is tagged Concurrency on LeetCode.