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 hints

Topics

Also asked at 13 companies


More Arista Networks Questions

View all Arista Networks questions