Ad
  • Custom User Avatar

    This solution works well for small inputs, but it checks every number up to n, making it inefficient for large values. A more optimized approach could iterate directly over multiples of 3 and 5 to reduce unnecessary checks.

  • Custom User Avatar

    This solution works well for small inputs, but it checks every number up to n, making it inefficient for large values. A more optimized approach could iterate directly over multiples of 3 and 5 to reduce unnecessary checks.