{"id":163,"date":"2017-11-02T20:01:23","date_gmt":"2017-11-02T12:01:23","guid":{"rendered":"https:\/\/www.ccagml.com\/?p=163"},"modified":"2018-11-27T17:02:40","modified_gmt":"2018-11-27T09:02:40","slug":"172-factorial-trailing-zeroes","status":"publish","type":"post","link":"https:\/\/www.ccagml.com\/?p=163","title":{"rendered":"172. Factorial Trailing Zeroes"},"content":{"rendered":"<p>Given an integer\u00a0<i>n<\/i>, return the number of trailing zeroes in\u00a0<i>n<\/i>!.<\/p>\n<p><strong>Example 1:<\/strong><\/p>\n<pre><strong>Input:<\/strong> 3\r\n<strong>Output:<\/strong> 0\r\n<strong>Explanation:<\/strong>\u00a03! = 6, no trailing zero.<\/pre>\n<p><strong>Example 2:<\/strong><\/p>\n<pre><strong>Input:<\/strong> 5\r\n<strong>Output:<\/strong> 1\r\n<strong>Explanation:<\/strong>\u00a05! = 120, one trailing zero.<\/pre>\n<p><b>Note:\u00a0<\/b>Your solution should be in logarithmic time complexity.<\/p>\n<p><strong>Python<\/strong><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\"> \r\nclass Solution(object):\r\n    def trailingZeroes(self, n):\r\n        &quot;&quot;&quot;\r\n        :type n: int\r\n        :rtype: int\r\n        &quot;&quot;&quot;\r\n        if n == 0:\r\n            return 0\r\n        else:\r\n            return n\/5 + self.trailingZeroes(n\/5)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Given an integer\u00a0n, return the number of trailing zeroe<a href=\"https:\/\/www.ccagml.com\/?p=163\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">172. Factorial Trailing Zeroes<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29,20],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/163"}],"collection":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":1,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccagml.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}