Skip to content

Instantly share code, notes, and snippets.

@ramesh4sr
ramesh4sr / DeTour.java
Last active December 10, 2015 08:38
Java DeTour Implementation
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Calculate the detour distance between two different rides. Given four
* latitude / longitude pairs, where driver one is traveling from point A to
* point B and driver two is traveling from point C to point D, write a function
* (in your language of choice) to calculate the shorter of the detour distances