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
0
Answer:
BSHUEUSUUUEU your welcome and I y h same
Similar questions
English,
4 months ago
Hindi,
4 months ago
Social Sciences,
4 months ago
English,
8 months ago
Science,
11 months ago
Social Sciences,
11 months ago
Biology,
11 months ago