Skip to content

Latest commit

 

History

History
 
 

0220.contains-duplicate-iii

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

题目

Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference between i and j is at most k.

解题思路

存在 | i - j | <= k 使得 | nums[i] - nums[j] | <= t

见程序注释