

The position given will always be less than or equal to the length of the linked list. Assume all the indexing starts from '0'.
Input : 'k' = 1, 'val' = 5, 'list' = [1, 2, 3, 4]
Output: 1 5 2 3 4
Explanation:
The node with 'data' = 5, is inserted at position 1(0 indexed) in the circular linked list as follows:
The first line of input contains three integers 'n', ‘k’, and 'val', denoting the length of the linked list, the position of insertion operation, and the value of 'data' of new node to be inserted in the list respectively.
The second line of input contains an array of positive integers denoting the nodes of the linked list.
The last element of the list always points to the first element in the list in order for the list to be a circular linked list.
Print the circular linked list after the insertion operation.
You don't need to print anything. It has already been taken care of. Just implement the given function.
Return the head of the modified linked list. Your returned linked list will be validated to check if it's a circular linked list and it's data printed. If your returned linked list is not a circular linked list, '-1' will be printed.
Approach:
Iterate the list starting from the head to the ‘Kth’ node.
Insert a new node ‘TEMP’ which is pointing to the ‘Kth’ node next and then change the ‘Kth’ node next to ‘TEMP’. Like:
Algorithm :