1. Reverse Linked List in Groups of K You are provided with a linked list containing 'N' nodes and an integer 'K'. The task is to reverse the linked list in groups of size K, which means reversing the nodes in each group (1,K),(K+1,2*K), etc. Example: Input: List: [1, 2, 3, 4, 5, 6], K = 2 Output: [2, 1, 4, 3, 6, 5] Explanation: The nodes are reversed in pairs: [1, 2] -> [2, 1], [3, 4] -> [4, 3], [5, 6] -> [6, 5]. Constraints: 1 <= T <= 100 1 <= N <= 10^4 1 <= K <= 10^4 Time Limit: 1sec Input: The first line of input contains an integer 'T' representing the number of test cases. Each test case follows with:1. A line containing a linked list where elements are separated by spaces and the list is terminated by -1.2. A line containing the integer K. Output: For each test case, output the modified linked list elements, separated by spaces, on a new line. Note: If the number of elements in the last group cannot be evenly divided by K, reverse that last group. For example, for list [1, 2, 3, 4, 5] and K = 3, the output is [3, 2, 1, 5, 4]. All node values in the linked list are distinct.
2. How do you use the SELECT command?
3. Permutation In String Problem Statement Given two strings, str1 and str2, determine whether str2 contains any permutation of str1 as a substring. Input: str1 = “ab”str2 = “aoba” Output: True Example: Explanation: Permutations of str1 = “ab” are [“ab”, “ba”]. Substrings of str2 = “aoba” are [“a”, “o”, “b”, “a”, “ao”, “ob”, “ba”, “aob”, “oba”, “aoba”]. The string “ba” is present, hence the output is True. Constraints: 1 <= T <= 10 1 <= N <= 10^4 1 <= M <= 10^4 Strings str1 and str2 consist only of lowercase letters. Note: You do not need to print anything, as it is managed internally. Just implement the given function to solve the problem.
4. Given an array of integers, find the contiguous subarray with the largest sum and return that sum.
5. Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must contain the digits 1-9 without repetition. Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9 without repetition. Note: A Sudoku board (partially filled) could be valid but is not necessarily solvable. Only the filled cells need to be validated according to the mentioned rules.