TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ashish Sahu
NA
141
7.2k
Count Pairs of Numbers with a Given Difference K
Aug 7 2015 3:41 PM
Hi Experts,
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Return count of such pairs.
Example k=4 and a[]={7,623,19,10,11,9,3,15}
Output should be : 6
Pairs can be:
7,11(11-7=4)
7,3(7-3=4)
6,10(10-6=4)
19,23(23-19=4)
15,19(19-15=4)
15,11(15-11=4)
Please Help me.
Thanks & Regards
Ashish Kumar Sahu
Reply
Answers (
1
)
Find Word without repeating character
Disable Alt+F4 and Esc in VB.net application