leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

commit d82261e1b5da10eab3d231d7353f142e5b786518
parent 892ece7ba6ed097f987cc1c7863f832d6f96d419
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Sat, 16 Dec 2023 17:16:01 +0000

1 Random Problem

Diffstat:
AProblems/0172.cpp | 9+++++++++
MREADME.md | 1+
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Problems/0172.cpp b/Problems/0172.cpp @@ -0,0 +1,9 @@ +class Solution { + public: + int trailingZeroes(int n) const { + int res = 0; + while (n > 0) + n /= 5, res += n; + return res; + } +}; diff --git a/README.md b/README.md @@ -176,6 +176,7 @@ for solving problems. | 0168 | Easy | [Excel Sheet Column Title](Problems/0168.cpp) | | 0169 | Easy | [Majority Element](Problems/0169.cpp) | | 0171 | Easy | [Excel Sheet Column Number](Problems/0171.cpp) | +| 0172 | Medium | [Factorial Trailing Zeroes](Problems/0172.cpp) | | 0173 | Medium | [Binary Search Tree Iterator](Problems/0173.cpp) | | 0175 | Easy | [Combine Two Tables](Problems/0175.cpp) | | 0176 | Medium | [Second Highest Salary](Problems/0176.cpp) |