Computer Science, asked by pragatiaswani123, 8 months ago

Coding Area
A
B
с
D
E
F
ONLINE EDITOR (A)
Count Pairs
Problem Description
Given an array of integers A, and an integer K find number of happy elements.
Element X is happy if there exists at least 1 element whose difference is less than Kie, an element X is happy, if there is another element in the range [X-K, X+K]
other than X itself.
-
Constraints
1 <= N <= 10^5
0 <= K <= 1045
0 <= A[i] <= 10^9
Input
First line contains two integers N and K where N is size of the array and Kis a number as described above
Second line contains N integers separated by space.
5:42 PM
08/08/2020​

Answers

Answered by ravindrasonwane004
0

Answer:

BSHUEUSUUUEU your welcome and I y h same

Similar questions