Trying to solve this problem. I got the last non-zero digit by working with $$$2$$$-s and $$$5$$$-s, but here's an easier solution by using $$$10$$$ directly.
Can anyone explain why this works? How taking modulo $$$10^9$$$ does not make it wrong?
Code
Thanks.