View allAll Photos Tagged two-same

You will not find two same columns in the famous cloister

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...

1 2 ••• 4 5 6 7 8 10