Given a sorted array and a number x, find a pair in array whose sum is closest to x.
Examples:
Input: arr[] = {10, 22, 28, 29, 32, 40}, x = 54
Output: 22 and 32
Examples:
Input: arr[] = {10, 22, 28, 29, 32, 40}, x = 54
Output: 22 and 32
1) Keep a Min & Max Heap of K size 2) Store first K elements in them. 3) If a new element comes with smaller or larger than root then reorder heap.
char * strtok ( char * str, const char * delimiters );
What it does : Split string into tokens
A sequence of calls to this function split str into tokens,
which are sequences of contiguous characters separated by any of
the characters that are part of delimiters