leetle

Daily challenge for 2025-01-01

1. FizzBuzz

Write a function solve that takes a number n and returns a list of numbers from 1 to n. If the number is divisible by 3, replace it with 'Fizz'. If the number is divisible by 5, replace it with 'Buzz'. If the number is divisible by both 3 and 5, replace it with 'FizzBuzz'.

Example:
Input: 15
Output: [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz']

Run this challenge interactively in Python or JavaScript when the app loads.