← all problems

Fix fizzBuzzWord (Error 1) 🌶️🌶️

The method below is supposed to return the FizzBuzz word for the positive int n: "FizzBuzz" for a multiple of both 3 and 5, "Fizz" for a multiple of 3 only, "Buzz" for a multiple of 5 only, and the number as a String otherwise. It says "FizzBuzz" for numbers that are only multiples of 3 or only multiples of 5. Find the bug and fix it. Run the tests and read each result: a wrong value tells you which inputs go wrong.