摘要: 190:颠倒二进制位 位运算一直是我的弱项 class Solution: def reverseBits(self, n: int) -> int: ans = 0 for i in range(32): if n & 1 << i: ans += 1 << (31 - i) return ans 阅读全文
posted @ 2022-03-26 21:17 yi术家 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 172 阶乘后的 0 : 0是由 2和5来的 2很多 所以数5的个数就行25有多少个5呢 25自己是2 20 15,10, 5 都是1个125有多少5呢 ? 125自己是3个 100,75,50,25 都是2个 其他的5的倍数都是1个 class Solution: def trailingZero 阅读全文
posted @ 2022-03-26 21:08 yi术家 阅读(23) 评论(0) 推荐(0) 编辑