public static void main(String args[]) {
        int[] nums = {1, 1, 4, 5, 9, 11};
        int[] nums1 = {1, 0, -1, 0, -2, 2};
        int target = 0;
        FourSum fourSum = new FourSum();
        List<List<Integer>> result = fourSum.fourSum(nums1, target);
        result.forEach(System.out::print);
    }
Date 07/31/2016
@author Tushar Roy

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?
Find all unique quadruplets in the array which gives the sum of target.

Time complexity O(n^3)
Space complexity O(1)

Reference
https://leetcode.com/problems/4sum/
src/com/interview/array/FourSum.java