Python | Leetcode Python题解之第220题存在重复元素III
题目: 题解:
class Solution(object):def containsNearbyAlmostDuplicate(self, nums, k, t):from sortedcontainers import SortedSetst SortedSet()left, right 0, 0res 0while right < len(nums):if right - left > k:st.remove(nums[left]…
数据结构与算法
2024/7/8 21:51:37