Last Non-Zero Digit
CodeChefOpen on judge ↗
Chef's friend Hanzala gave him a non-negative integer $N$ and asked him to find the position of the last non-zero digit (from the left) in $N!$. As an example, let $N = 7$. Also, $7! = 5040$. So, the position of the last non-zero digit in $7!$ is $3$. Chef tried hard but couldn't solve the problem. Can you? ###Input: - First line will contain $T$, number of testcases. Then the testcase
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start