1. Fizz Buzz
Write fizzBuzz n, which describes the number n the way the counting game does: "Fizz" when n is divisible by 3, "Buzz" when it is divisible by 5, "FizzBuzz" when it is divisible by both, and the number itself, as a string, otherwise.
Examples
Input: fizzBuzz 3Output: "Fizz"Input: fizzBuzz 10Output: "Buzz"Input: fizzBuzz 30Output: "FizzBuzz"Input: fizzBuzz 7Output: "7"
Submitting also runs 8 hidden tests.
Constraints
- 0 is divisible by every number.
toString nturns a number into its decimal string:toString 7is"7".
Loading editor…
Type
\to in the editor, or click:Run checks your code against the examples and your custom inputs and records nothing. Submit also runs the hidden tests, confirms the axioms your proof uses and records the result. Each uses one compiler check.
ReadyLn 1, Col 1Lean 4
Draft saved in this browser