Skip to content

Instantly share code, notes, and snippets.

View longda's full-sized avatar

David Long longda

View GitHub Profile
Given N integers, count the number of pairs of integers whose difference is K.
Input Format
The first line contains N and K.
The second line contains N numbers of the set. All the N numbers are unique.
longda /
Last active August 29, 2015 14:15
/* package whatever dijkstra w/ priority queue; // don't place package name! */
import java.util.PriorityQueue;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
class Vertex implements Comparable<Vertex>