# Find all pairs in an array with a given difference k

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/1128/find-pairs-with-difference-k
Source observed: 2026-11-05T00:45:24.190Z
Last checked: 2026-11-05T00:45:24.19+00:00
Indexed: 2026-11-07T02:24:09.738+00:00

---

# Find all pairs in an array with a given difference k

We provide this coding-interview question in Aced’s question library. The task is to find all pairs in an array whose difference is a specified value `k`.

## Community answers

No answers have been contributed by the community yet.

To answer, you must [log in or sign up](https://www.aced.io/login?src=nav) to Aced. Submitting an answer marks the question complete.

## Related questions

- [Find a triplet in an array with a given sum.](https://www.aced.io/questions/1127/find-triplet-with-given-sum)
- [Find quadruplets in an array with a given sum.](https://www.aced.io/questions/1129/find-quadruplets-with-given-sum)
- [Given an array of integers, return the pairs with the minimum absolute difference between them.](https://www.aced.io/questions/5443/coding-array-pairs-minimum-difference)

## Your answer

Use the answer submission area after signing in. The available action is **Submit**.

## Explore Aced

We are Aced, formerly Exponent, and we offer interview preparation through courses, practice questions, interview loops, experiences, and coaching.

- [All questions](https://www.aced.io/questions)
- [Coding questions](https://www.aced.io/questions?type=algorithms&filterBy=codeEditor&src=nav)
- [Software Engineering course](https://www.aced.io/courses/software-engineering?src=nav) — essential strategies for coding problems and more.
- [System Design course](https://www.aced.io/courses/system-design-interviews?src=nav) — architectures, interfaces, and databases in a time crunch.
- [Practice](https://www.aced.io/practice?src=nav)
- [Mock interviews and coaching](https://www.aced.io/coaching?category=mock_interviews&src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Sign up](https://www.aced.io/signup?src=nav)
- [Log in](https://www.aced.io/login?src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F1128%2Ffind-pairs-with-difference-k&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F1128%2Ffind-pairs-with-difference-k). Opening a form does not execute a tool.