Q1. Given a linked list with each node’s data being either a character or whitespace. Reverse the words of the linked list.
Input: T->h->i->s-> ->i->s-> ->a-> ->h->o->u->s->e
Output: s->i->h->T-> ->s->i-> ->a-> ->e->s->u->o->h
Q2. Given an array, find triplets such that : Uniq (a, b, c) -> (val = val[a]+val[b]) where a, b, c are indexes of the array.
Input array: [2, 2, 4, 6, 6, 8, 10, 12]
Output should be: (0, 3, 5) (1, 3, 5) (0, 4, 5) (0, 2, 3) (1, 2, 3) (1, 4, 5) …..and others