3 ms·
Python tricks and techniques for concise Leetcode
- vanusa 5y agoAmong the many things to hate about LC: in most circumstances (in Python land, now) you wouldn't be too happy with someone for mindlessly cranking out a full-fledged class (with some apparent confusion thrown in about the nature of the first argument in what is apparently a class method) when clearly a pure function would do -- and with a Java-style camel case method name, no less? But in the LC universe, you are required to do exactly that: class Solution: def trailingZeroes(self, n: int) -> int: The impracticalprogrammer site is kind of fun though, and accurately named.