Company: Barclays
Difficulty: medium
Lucky Customers Gift Basket Write an algorithm to help the Manager find the total numbers of lucky customers who will win a gift basket. Input Format The first line of the input consists of an integer list_input_size , representing the types of products(N). The second line consists of N space-separated integers - list_input[0] , list_input[1] , ..., list_input[N-1] , representing the price of the products. The last line consists of an integer k_input , representing the given value K. Output Format Print an integer representing the total number of lucky customers who will win a gift basket. Constraints 1 ≤ list_input_size ≤ 10 6 0 ≤ k_input ≤ 10 9 0 ≤ list_input[0], list_input[1], ..., list_input[N-1] ≤ 10 9 Example Input: 6 10 15 23 14 2 15 13 Output: 3 There are 3 pairs with difference 13; the pairs are (10, 23), (15, 2) and (2, 15). So, the output is 3. Code Template public static void main(String[] args) { Scanner in = new Scanner(System.in); //input for list_input int list_input_si