News

0: n &= n -1 cnt += 1 return cnt == 1 跟power of three一样递归,可以AC class Solution(object): def isPowerOfTwo(self, n): """ :type n: int :rtype: bool """ if n <= 0 : return False if n == 1: return True if n ...
This repo documents my 20 days of LeetCode problems solved ... sliding window, and two-pointer techniques. By solving these problems, I aimed to improve my problem-solving skills, deepen my ...