Loading

摘要: 题面 LC1513 代码 class Solution: def numSub(self, s: str) -> int: subLens = [] count = 0 for i in range(len(s)): if s[i] == '1': count+=1 elif s[i] == '0' 阅读全文
posted @ 2025-11-17 11:59 kozumi 阅读(5) 评论(0) 推荐(0)
摘要: 题面 LC1437 代码 class Solution: def kLengthApart(self, nums: List[int], k: int) -> bool: # 维护当前的1之间的最小间距 minApart = +inf numZeros = 0 found1 = False for 阅读全文
posted @ 2025-11-17 11:57 kozumi 阅读(4) 评论(0) 推荐(0)
摘要: 题面 LC2257 代码 class Solution { public: int countUnguarded(int m, int n, vector<vector<int>>& guards, vector<vector<int>>& walls) { // we define: // 0: 阅读全文
posted @ 2025-11-17 11:53 kozumi 阅读(5) 评论(0) 推荐(0)