Contains Duplicate II at Arista Networks
Easy50.8% acceptance
This problem has 75.0% frequency at Arista Networks.
Problem Description
Given an integer array `nums` and an integer `k`, return `true` _if there are two**distinct indices** _`i` _and_`j` _in the array such that_`nums[i] == nums[j]`_and_`abs(i - j) <= k`.
Read full problem and hintsTopics
Also asked at 13 companies
More Arista Networks Questions
Find the Town JudgeEasyConstruct String With Repeat LimitMediumMissing NumberEasyCopy List with Random PointerMediumBest Time to Buy and Sell StockEasy
View all Arista Networks questions