1. Fizz Buzz

EasyProgramFree10 points

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

  1. InputfizzBuzz 3Output"Fizz"
  2. InputfizzBuzz 10Output"Buzz"
  3. InputfizzBuzz 30Output"FizzBuzz"
  4. InputfizzBuzz 7Output"7"

Submitting also runs 8 hidden tests.

Constraints

  • 0 is divisible by every number.
Solution.lean
Loading editor…

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