leetle

Daily challenge for 2025-07-14

195. Calculate Factorial Iteratively

Write a function solve that takes a non-negative integer n and returns its factorial (n!). Use an iterative approach, not recursion.

Example:
Input: 5
Output: 120

Because 5! = 5 × 4 × 3 × 2 × 1 = 120

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