← All problemsSign in

Problem 6

Given N numbers , [N0 and KInput Format: 1st line contains N & K (integers). 2nd line contains N numbers of the set. All the N numbers are assured to be distinct. Output Format: One integer saying the no of pairs of numbers that have a diff K. Sample Input #0: 5 2 1 5 3 4 2 Sample Output #0: 3 Sample Input #1: 10 1 363374326 364147530 61825163 1073065718 1281246024 1399469912 428047635 49159525

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start