Split Linked List into two halves fractionally given n
Problem Given a linked list with head pointer and a number n. Split the linked list into two halves such that first half contains 1/n elements and remaining linkedlist contains remaining elements. Return the head of the second list or the right partition pointer. Examples Example 1: Input: head = [1, 2, 3, 4, 5, 6, 7, 8], n = 2 Output: [5, 6, 7, 8] Explanation: As n = 2, we have 2 lists like this [ [1, 2, 3, 4], [5, 6, 7, 8] ] and we return the list with head at 5. ...