ShwStone/humaneval-leetcode huggingface dataset:
def arrangeWords(text: str) -> str:
    """
    Given a sentence text (A sentence is a string of space-separated words) in the following format:
    
    First letter is in upper case.
    Each word in text are separated by a single space.
    
    Your task is to rearrange the words in text such that all words are rearranged in an increasing order of their lengths. If two words have the same length, arrange them in their original order.
    Return the new text following the format shown above.
    
    Example 1:
    
    >>> arrangeWords(text = "Leetcode is cool")
    >>> "Is cool leetcode"
    Explanation: There are 3 words, "Leetcode" of length 8, "is" of length 2 and "cool" of length 4.
    Output is ordered by length and the new first word starts with capital letter.
    
    Example 2:
    
    >>> arrangeWords(text = "Keep calm and code on")
    >>> "On and keep calm code"
    Explanation: Output is ordered as follows:
    "On" 2 letters.
    "and" 3 letters.
    "keep" 4 letters in case of tie order by position in original text.
    "calm" 4 letters.
    "code" 4 letters.
    
    Example 3:
    
    >>> arrangeWords(text = "To be or not to be")
    >>> "To be or to be not"
    """
def peopleIndexes(favoriteCompanies: List[List[str]]) -> List[int]:
    """
    Given the array favoriteCompanies where favoriteCompanies[i] is the list of favorites companies for the ith person (indexed from 0).
    Return the indices of people whose list of favorite companies is not a subset of any other list of favorites companies. You must return the indices in increasing order.
    
    Example 1:
    
    >>> peopleIndexes(favoriteCompanies = [["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]])
    >>> [0,1,4]
    Explanation:
    Person with index=2 has favoriteCompanies[2]=["google","facebook"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] corresponding to the person with index 0.
    Person with index=3 has favoriteCompanies[3]=["google"] which is a subset of favoriteCompanies[0]=["leetcode","google","facebook"] and favoriteCompanies[1]=["google","microsoft"].
    Other lists of favorite companies are not a subset of another list, therefore, the answer is [0,1,4].
    
    Example 2:
    
    >>> peopleIndexes(favoriteCompanies = [["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]])
    >>> [0,1]
    Explanation: In this case favoriteCompanies[2]=["facebook","google"] is a subset of favoriteCompanies[0]=["leetcode","google","facebook"], therefore, the answer is [0,1].
    
    Example 3:
    
    >>> peopleIndexes(favoriteCompanies = [["leetcode"],["google"],["facebook"],["amazon"]])
    >>> [0,1,2,3]
    """
def numPoints(darts: List[List[int]], r: int) -> int:
    """
    Alice is throwing n darts on a very large wall. You are given an array darts where darts[i] = [xi, yi] is the position of the ith dart that Alice threw on the wall.
    Bob knows the positions of the n darts on the wall. He wants to place a dartboard of radius r on the wall so that the maximum number of darts that Alice throws lie on the dartboard.
    Given the integer r, return the maximum number of darts that can lie on the dartboard.
    
    Example 1:
    
    
    >>> numPoints(darts = [[-2,0],[2,0],[0,2],[0,-2]], r = 2)
    >>> 4
    Explanation: Circle dartboard with center in (0,0) and radius = 2 contain all points.
    
    Example 2:
    
    
    >>> numPoints(darts = [[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5)
    >>> 5
    Explanation: Circle dartboard with center in (0,4) and radius = 5 contain all points except the point (7,8).
    """
def isPrefixOfWord(sentence: str, searchWord: str) -> int:
    """
    Given a sentence that consists of some words separated by a single space, and a searchWord, check if searchWord is a prefix of any word in sentence.
    Return the index of the word in sentence (1-indexed) where searchWord is a prefix of this word. If searchWord is a prefix of more than one word, return the index of the first word (minimum index). If there is no such word return -1.
    A prefix of a string s is any leading contiguous substring of s.
    
    Example 1:
    
    >>> isPrefixOfWord(sentence = "i love eating burger", searchWord = "burg")
    >>> 4
    Explanation: "burg" is prefix of "burger" which is the 4th word in the sentence.
    
    Example 2:
    
    >>> isPrefixOfWord(sentence = "this problem is an easy problem", searchWord = "pro")
    >>> 2
    Explanation: "pro" is prefix of "problem" which is the 2nd and the 6th word in the sentence, but we return 2 as it's the minimal index.
    
    Example 3:
    
    >>> isPrefixOfWord(sentence = "i am tired", searchWord = "you")
    >>> -1
    Explanation: "you" is not a prefix of any word in the sentence.
    """
def maxVowels(s: str, k: int) -> int:
    """
    Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.
    Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
    
    Example 1:
    
    >>> maxVowels(s = "abciiidef", k = 3)
    >>> 3
    Explanation: The substring "iii" contains 3 vowel letters.
    
    Example 2:
    
    >>> maxVowels(s = "aeiou", k = 2)
    >>> 2
    Explanation: Any substring of length 2 contains 2 vowels.
    
    Example 3:
    
    >>> maxVowels(s = "leetcode", k = 3)
    >>> 2
    Explanation: "lee", "eet" and "ode" contain 2 vowels.
    """
def maxDotProduct(nums1: List[int], nums2: List[int]) -> int:
    """
    Given two arrays nums1 and nums2.
    Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length.
    A subsequence of a array is a new array which is formed from the original array by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, [2,3,5] is a subsequence of [1,2,3,4,5] while [1,5,3] is not).
    
    Example 1:
    
    >>> maxDotProduct(nums1 = [2,1,-2,5], nums2 = [3,0,-6])
    >>> 18
    Explanation: Take subsequence [2,-2] from nums1 and subsequence [3,-6] from nums2.
    Their dot product is (2*3 + (-2)*(-6)) = 18.
    Example 2:
    
    >>> maxDotProduct(nums1 = [3,-2], nums2 = [2,-6,7])
    >>> 21
    Explanation: Take subsequence [3] from nums1 and subsequence [7] from nums2.
    Their dot product is (3*7) = 21.
    Example 3:
    
    >>> maxDotProduct(nums1 = [-1,-1], nums2 = [1,1])
    >>> -1
    Explanation: Take subsequence [-1] from nums1 and subsequence [1] from nums2.
    Their dot product is -1.
    """
def canBeEqual(target: List[int], arr: List[int]) -> bool:
    """
    You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You are allowed to make any number of steps.
    Return true if you can make arr equal to target or false otherwise.
    
    Example 1:
    
    >>> canBeEqual(target = [1,2,3,4], arr = [2,4,1,3])
    >>> true
    Explanation: You can follow the next steps to convert arr to target:
    1- Reverse subarray [2,4,1], arr becomes [1,4,2,3]
    2- Reverse subarray [4,2], arr becomes [1,2,4,3]
    3- Reverse subarray [4,3], arr becomes [1,2,3,4]
    There are multiple ways to convert arr to target, this is not the only way to do so.
    
    Example 2:
    
    >>> canBeEqual(target = [7], arr = [7])
    >>> true
    Explanation: arr is equal to target without any reverses.
    
    Example 3:
    
    >>> canBeEqual(target = [3,7,9], arr = [3,7,11])
    >>> false
    Explanation: arr does not have value 9 and it can never be converted to target.
    """
def hasAllCodes(s: str, k: int) -> bool:
    """
    Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false.
    
    Example 1:
    
    >>> hasAllCodes(s = "00110110", k = 2)
    >>> true
    Explanation: The binary codes of length 2 are "00", "01", "10" and "11". They can be all found as substrings at indices 0, 1, 3 and 2 respectively.
    
    Example 2:
    
    >>> hasAllCodes(s = "0110", k = 1)
    >>> true
    Explanation: The binary codes of length 1 are "0" and "1", it is clear that both exist as a substring.
    
    Example 3:
    
    >>> hasAllCodes(s = "0110", k = 2)
    >>> false
    Explanation: The binary code "00" is of length 2 and does not exist in the array.
    """
def checkIfPrerequisite(numCourses: int, prerequisites: List[List[int]], queries: List[List[int]]) -> List[bool]:
    """
    There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi.
    
    For example, the pair [0, 1] indicates that you have to take course 0 before you can take course 1.
    
    Prerequisites can also be indirect. If course a is a prerequisite of course b, and course b is a prerequisite of course c, then course a is a prerequisite of course c.
    You are also given an array queries where queries[j] = [uj, vj]. For the jth query, you should answer whether course uj is a prerequisite of course vj or not.
    Return a boolean array answer, where answer[j] is the answer to the jth query.
    
    Example 1:
    
    
    >>> checkIfPrerequisite(numCourses = 2, prerequisites = [[1,0]], queries = [[0,1],[1,0]])
    >>> [false,true]
    Explanation: The pair [1, 0] indicates that you have to take course 1 before you can take course 0.
    Course 0 is not a prerequisite of course 1, but the opposite is true.
    
    Example 2:
    
    >>> checkIfPrerequisite(numCourses = 2, prerequisites = [], queries = [[1,0],[0,1]])
    >>> [false,false]
    Explanation: There are no prerequisites, and each course is independent.
    
    Example 3:
    
    
    >>> checkIfPrerequisite(numCourses = 3, prerequisites = [[1,2],[1,0],[2,0]], queries = [[1,0],[1,2]])
    >>> [true,true]
    """
def cherryPickup(grid: List[List[int]]) -> int:
    """
    You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j) cell.
    You have two robots that can collect cherries for you:
    
    Robot #1 is located at the top-left corner (0, 0), and
    Robot #2 is located at the top-right corner (0, cols - 1).
    
    Return the maximum number of cherries collection using both robots by following the rules below:
    
    From a cell (i, j), robots can move to cell (i + 1, j - 1), (i + 1, j), or (i + 1, j + 1).
    When any robot passes through a cell, It picks up all cherries, and the cell becomes an empty cell.
    When both robots stay in the same cell, only one takes the cherries.
    Both robots cannot move outside of the grid at any moment.
    Both robots should reach the bottom row in grid.
    
    
    Example 1:
    
    
    >>> cherryPickup(grid = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]])
    >>> 24
    Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
    Cherries taken by Robot #1, (3 + 2 + 5 + 2) = 12.
    Cherries taken by Robot #2, (1 + 5 + 5 + 1) = 12.
    Total of cherries: 12 + 12 = 24.
    
    Example 2:
    
    
    >>> cherryPickup(grid = [[1,0,0,0,0,0,1],[2,0,0,0,0,3,0],[2,0,9,0,0,0,0],[0,3,0,5,4,0,0],[1,0,2,3,0,0,6]])
    >>> 28
    Explanation: Path of robot #1 and #2 are described in color green and blue respectively.
    Cherries taken by Robot #1, (1 + 9 + 5 + 2) = 17.
    Cherries taken by Robot #2, (1 + 3 + 4 + 3) = 11.
    Total of cherries: 17 + 11 = 28.
    """
def maxProduct(nums: List[int]) -> int:
    """
    Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1).
    
    Example 1:
    
    >>> maxProduct(nums = [3,4,5,2])
    >>> 12
    Explanation: If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12.
    
    Example 2:
    
    >>> maxProduct(nums = [1,5,4,5])
    >>> 16
    Explanation: Choosing the indices i=1 and j=3 (indexed from 0), you will get the maximum value of (5-1)*(5-1) = 16.
    
    Example 3:
    
    >>> maxProduct(nums = [3,7])
    >>> 12
    """
def maxArea(h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int:
    """
    You are given a rectangular cake of size h x w and two arrays of integers horizontalCuts and verticalCuts where:
    
    horizontalCuts[i] is the distance from the top of the rectangular cake to the ith horizontal cut and similarly, and
    verticalCuts[j] is the distance from the left of the rectangular cake to the jth vertical cut.
    
    Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrays horizontalCuts and verticalCuts. Since the answer can be a large number, return this modulo 109 + 7.
    
    Example 1:
    
    
    >>> maxArea(h = 5, w = 4, horizontalCuts = [1,2,4], verticalCuts = [1,3])
    >>> 4
    Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green piece of cake has the maximum area.
    
    Example 2:
    
    
    >>> maxArea(h = 5, w = 4, horizontalCuts = [3,1], verticalCuts = [1])
    >>> 6
    Explanation: The figure above represents the given rectangular cake. Red lines are the horizontal and vertical cuts. After you cut the cake, the green and yellow pieces of cake have the maximum area.
    
    Example 3:
    
    >>> maxArea(h = 5, w = 4, horizontalCuts = [3], verticalCuts = [3])
    >>> 9
    """
def minReorder(n: int, connections: List[List[int]]) -> int:
    """
    There are n cities numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction because they are too narrow.
    Roads are represented by connections where connections[i] = [ai, bi] represents a road from city ai to city bi.
    This year, there will be a big event in the capital (city 0), and many people want to travel to this city.
    Your task consists of reorienting some roads such that each city can visit the city 0. Return the minimum number of edges changed.
    It's guaranteed that each city can reach city 0 after reorder.
    
    Example 1:
    
    
    >>> minReorder(n = 6, connections = [[0,1],[1,3],[2,3],[4,0],[4,5]])
    >>> 3
    Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
    
    Example 2:
    
    
    >>> minReorder(n = 5, connections = [[1,0],[1,2],[3,2],[3,4]])
    >>> 2
    Explanation: Change the direction of edges show in red such that each node can reach the node 0 (capital).
    
    Example 3:
    
    >>> minReorder(n = 3, connections = [[1,0],[2,0]])
    >>> 0
    """
def getProbability(balls: List[int]) -> float:
    """
    Given 2n balls of k distinct colors. You will be given an integer array balls of size k where balls[i] is the number of balls of color i.
    All the balls will be shuffled uniformly at random, then we will distribute the first n balls to the first box and the remaining n balls to the other box (Please read the explanation of the second example carefully).
    Please note that the two boxes are considered different. For example, if we have two balls of colors a and b, and two boxes [] and (), then the distribution [a] (b) is considered different than the distribution [b] (a) (Please read the explanation of the first example carefully).
    Return the probability that the two boxes have the same number of distinct balls. Answers within 10-5 of the actual value will be accepted as correct.
    
    Example 1:
    
    >>> getProbability(balls = [1,1])
    >>> 1.00000
    Explanation: Only 2 ways to divide the balls equally:
    - A ball of color 1 to box 1 and a ball of color 2 to box 2
    - A ball of color 2 to box 1 and a ball of color 1 to box 2
    In both ways, the number of distinct colors in each box is equal. The probability is 2/2 = 1
    
    Example 2:
    
    >>> getProbability(balls = [2,1,1])
    >>> 0.66667
    Explanation: We have the set of balls [1, 1, 2, 3]
    This set of balls will be shuffled randomly and we may have one of the 12 distinct shuffles with equal probability (i.e. 1/12):
    [1,1 / 2,3], [1,1 / 3,2], [1,2 / 1,3], [1,2 / 3,1], [1,3 / 1,2], [1,3 / 2,1], [2,1 / 1,3], [2,1 / 3,1], [2,3 / 1,1], [3,1 / 1,2], [3,1 / 2,1], [3,2 / 1,1]
    After that, we add the first two balls to the first box and the second two balls to the second box.
    We can see that 8 of these 12 possible random distributions have the same number of distinct colors of balls in each box.
    Probability is 8/12 = 0.66667
    
    Example 3:
    
    >>> getProbability(balls = [1,2,1,2])
    >>> 0.60000
    Explanation: The set of balls is [1, 2, 2, 3, 4, 4]. It is hard to display all the 180 possible random shuffles of this set but it is easy to check that 108 of them will have the same number of distinct colors in each box.
    Probability = 108 / 180 = 0.6
    """
# class TreeNode:
#     def __init__(val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right
class Solution:
    def getLonelyNodes(root: Optional[TreeNode]) -> List[int]:
    """
    In a binary tree, a lonely node is a node that is the only child of its parent node. The root of the tree is not lonely because it does not have a parent node.
    Given the root of a binary tree, return an array containing the values of all lonely nodes in the tree. Return the list in any order.
    
    Example 1:
    
    
    >>> __init__(root = [1,2,3,null,4])
    >>> [4]
    Explanation: Light blue node is the only lonely node.
    Node 1 is the root and is not lonely.
    Nodes 2 and 3 have the same parent and are not lonely.
    
    Example 2:
    
    
    >>> __init__(root = [7,1,4,6,null,5,3,null,null,null,null,null,2])
    >>> [6,2]
    Explanation: Light blue nodes are lonely nodes.
    Please remember that order doesn't matter, [2,6] is also an acceptable answer.
    
    Example 3:
    
    
    
    >>> __init__(root = [11,99,88,77,null,null,66,55,null,null,44,33,null,null,22])
    >>> [77,55,33,66,44,22]
    Explanation: Nodes 99 and 88 share the same parent. Node 11 is the root.
    All other nodes are lonely.
    """
def shuffle(nums: List[int], n: int) -> List[int]:
    """
    Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].\r
    \r
    Return the array in the form [x1,y1,x2,y2,...,xn,yn].\r
    \r
     \r
    Example 1:\r
    \r
    \r
    >>> shuffle(nums = [2,5,1,3,4,7], n = 3\r)
    >>> [2,3,5,4,1,7] \r
    Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7].\r
    \r
    \r
    Example 2:\r
    \r
    \r
    >>> shuffle(nums = [1,2,3,4,4,3,2,1], n = 4\r)
    >>> [1,4,2,3,3,2,4,1]\r
    \r
    \r
    Example 3:\r
    \r
    \r
    >>> shuffle(nums = [1,1,2,2], n = 2\r)
    >>> [1,2,1,2]\r
    \r
    \r
     \r
    """
def getStrongest(arr: List[int], k: int) -> List[int]:
    """
    Given an array of integers arr and an integer k.
    A value arr[i] is said to be stronger than a value arr[j] if |arr[i] - m| > |arr[j] - m| where m is the centre of the array.
    If |arr[i] - m| == |arr[j] - m|, then arr[i] is said to be stronger than arr[j] if arr[i] > arr[j].
    Return a list of the strongest k values in the array. return the answer in any arbitrary order.
    The centre is the middle value in an ordered integer list. More formally, if the length of the list is n, the centre is the element in position ((n - 1) / 2) in the sorted list (0-indexed).
    
    For arr = [6, -3, 7, 2, 11], n = 5 and the centre is obtained by sorting the array arr = [-3, 2, 6, 7, 11] and the centre is arr[m] where m = ((5 - 1) / 2) = 2. The centre is 6.
    For arr = [-7, 22, 17, 3], n = 4 and the centre is obtained by sorting the array arr = [-7, 3, 17, 22] and the centre is arr[m] where m = ((4 - 1) / 2) = 1. The centre is 3.
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    Example 1:
    
    >>> getStrongest(arr = [1,2,3,4,5], k = 2)
    >>> [5,1]
    Explanation: Centre is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also accepted answer.
    Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 > 1.
    
    Example 2:
    
    >>> getStrongest(arr = [1,1,3,5,5], k = 2)
    >>> [5,5]
    Explanation: Centre is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
    
    Example 3:
    
    >>> getStrongest(arr = [6,7,11,7,6,8], k = 5)
    >>> [11,8,6,6,7]
    Explanation: Centre is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
    Any permutation of [11,8,6,6,7] is accepted.
    """
def minCost(houses: List[int], cost: List[List[int]], m: int, n: int, target: int) -> int:
    """
    There is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted again.
    A neighborhood is a maximal group of continuous houses that are painted with the same color.
    
    For example: houses = [1,2,2,3,3,2,1,1] contains 5 neighborhoods [{1}, {2,2}, {3,3}, {2}, {1,1}].
    
    Given an array houses, an m x n matrix cost and an integer target where:
    
    houses[i]: is the color of the house i, and 0 if the house is not painted yet.
    cost[i][j]: is the cost of paint the house i with the color j + 1.
    
    Return the minimum cost of painting all the remaining houses in such a way that there are exactly target neighborhoods. If it is not possible, return -1.
    
    Example 1:
    
    >>> minCost(houses = [0,0,0,0,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3)
    >>> 9
    Explanation: Paint houses of this way [1,2,2,1,1]
    This array contains target = 3 neighborhoods, [{1}, {2,2}, {1,1}].
    Cost of paint all houses (1 + 1 + 1 + 1 + 5) = 9.
    
    Example 2:
    
    >>> minCost(houses = [0,2,1,2,0], cost = [[1,10],[10,1],[10,1],[1,10],[5,1]], m = 5, n = 2, target = 3)
    >>> 11
    Explanation: Some houses are already painted, Paint the houses of this way [2,2,1,2,2]
    This array contains target = 3 neighborhoods, [{2,2}, {1}, {2,2}].
    Cost of paint the first and last house (10 + 1) = 11.
    
    Example 3:
    
    >>> minCost(houses = [3,1,2,3], cost = [[1,1,1],[1,1,1],[1,1,1],[1,1,1]], m = 4, n = 3, target = 3)
    >>> -1
    Explanation: Houses are already painted with a total of 4 neighborhoods [{3},{1},{2},{3}] different of target = 3.
    """
# class ListNode:
#     def __init__(val=0, next=None):
#         self.val = val
#         self.next = next
class Solution:
    def deleteNodes(head: Optional[ListNode], m: int, n: int) -> Optional[ListNode]:
    """
    You are given the head of a linked list and two integers m and n.
    Traverse the linked list and remove some nodes in the following way:
    
    Start with the head as the current node.
    Keep the first m nodes starting with the current node.
    Remove the next n nodes
    Keep repeating steps 2 and 3 until you reach the end of the list.
    
    Return the head of the modified list after removing the mentioned nodes.
    
    Example 1:
    
    
    >>> __init__(head = [1,2,3,4,5,6,7,8,9,10,11,12,13], m = 2, n = 3)
    >>> [1,2,6,7,11,12]
    Explanation: Keep the first (m = 2) nodes starting from the head of the linked List  (1 ->2) show in black nodes.
    Delete the next (n = 3) nodes (3 -> 4 -> 5) show in read nodes.
    Continue with the same procedure until reaching the tail of the Linked List.
    Head of the linked list after removing nodes is returned.
    
    Example 2:
    
    
    >>> __init__(head = [1,2,3,4,5,6,7,8,9,10,11], m = 1, n = 3)
    >>> [1,5,9]
    Explanation: Head of linked list after removing nodes is returned.
    """