2020 第 34 周 LeetCode 记录

Yiran at 
1550. Three Consecutive Odds 链接到标题 判断数组是否存在连续 3 个奇数的情况存在,直接遍历判断,使用变量记录当前奇数个数。class Solution: def threeConsecutiveOdds(self, arr: List[int]) -> bool: cnt = 0 for i in arr: if i & 1: cnt += 1 else: cnt = 0 if cnt == 3: return True return False 1551. Minimum Operations to Make Array Equal 链接到标题 一道数学题,等……