InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-16

Count pairs with difference equal to k

AI-Expanded — inferred from the question title, not from the original candidate report

Given an array of integers and a target integer k, write a function to count the number of unique pairs of elements in the array that have an absolute difference exactly equal to k. Your solution should efficiently handle large input arrays, ideally operating in linear time complexity.

Context & Summary

Coding Round with 9 MCQs and 3 Coding Problems

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.