172. Factorial Trailing Zeroes
·
Algorithm
Factorial Trailing Zeroes - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 틀린 풀이 class Solution: def trailingZeroes(self, n: int) -> int: return n // 5 N이 주어지고 N! 의 0의 개수를 반환하는 문제다. 처음에는 DP 인가라고 생각을 했다가 좀 더 쉽게 생각할 수 있는 문제인 것 같았다. 0이 만들어지려면 10이 곱해져야 한다. 그리고 10은 2와 5의 곱이다. 즉 2와 5..