Back to photostream

Contains Duplicate II Leetcode Solution

Problem Statement

In this problem we are given an array of integers and we have to check if there exists any duplicate element which are at a distance of at least k to each other.

i.e. the difference between the indices of those two same element should be less than equal to k.

Or, nums==nums and abs(i-j)

 

www.tutorialcup.com/leetcode-solutions/contains-duplicate...

14 views
0 faves
0 comments
Uploaded on September 23, 2021
Taken on January 4, 2021