Find All Pairs Difference K Problem

Find All Pairs Difference K Problem — ExecCode Easy DSA Practice

Solve the Find All Pairs Difference K problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Find All Pairs Difference K. Your task is to in Find All Pairs Difference K, the goal is to transform, count, or select values according to the exact rule. A sequence of values is given, and order matters. n k then nums on next line. Return pairs one per line as a b.

Examples

Input {"nums": [1, 5, 3, 4, 2], "k": 2}; Output 1 3 2 4 3 5. Input {"nums": [4, 2, 3, 1], "k": 1}; Output 1 2 2 3 3 4. Input {"nums": [1, 2, 1], "k": 0}; Output 1 1

Constraints

1 <= len(nums) <= 10^4; 0 <= k <= 10^4

Practice Find All Pairs Difference K free on ExecCode. Browse DSA problems, topic map, and placement guides.