https://github.com/yankouskia/zeros
https://github.com/yankouskia/zeros
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yankouskia/zeros
- Owner: yankouskia
- License: mit
- Created: 2018-02-19T09:12:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T09:32:55.000Z (about 7 years ago)
- Last Synced: 2025-03-29T08:07:55.255Z (27 days ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 685
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zeros
Let's count zeros!## Task
Your task is to implement `getZerosCount` function, which takes any integer number `number` (`1 <= number <= 10^8`) as only argument. You should calculate *how many zeros in the end of result number, which is factorial of `number`*
For example:
```js
const zerosCount = getZerosCount(10); // Factorial of 10 is 3628800
console.log(zerosCount); // 2. Because there is 2 *tail* zeros in number 3628800
```### Important!
Do not try to calculate factorial! First - you will not get exact answer on big numbers. Second - it could take several years to calculate factorial on big integers! Try to think up your awesome solution without such calculations. Good luck!