ShwStone/humaneval-leetcode huggingface dataset:
def minRemoveToMakeValid(s: str) -> str:
    """
    Given a string s of '(' , ')' and lowercase English characters.
    Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string.
    Formally, a parentheses string is valid if and only if:
    
    It is the empty string, contains only lowercase characters, or
    It can be written as AB (A concatenated with B), where A and B are valid strings, or
    It can be written as (A), where A is a valid string.
    
    
    Example 1:
    
    >>> minRemoveToMakeValid(s = "lee(t(c)o)de)")
    >>> "lee(t(c)o)de"
    Explanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted.
    
    Example 2:
    
    >>> minRemoveToMakeValid(s = "a)b(c)d")
    >>> "ab(c)d"
    
    Example 3:
    
    >>> minRemoveToMakeValid(s = "))((")
    >>> ""
    Explanation: An empty string is also valid.
    """
def isGoodArray(nums: List[int]) -> bool:
    """
    Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers. The array is said to be good if you can obtain a sum of 1 from the array by any possible subset and multiplicand.
    Return True if the array is good otherwise return False.
    
    Example 1:
    
    >>> isGoodArray(nums = [12,5,7,23])
    >>> true
    Explanation: Pick numbers 5 and 7.
    5*3 + 7*(-2) = 1
    
    Example 2:
    
    >>> isGoodArray(nums = [29,6,10])
    >>> true
    Explanation: Pick numbers 29, 6 and 10.
    29*1 + 6*(-3) + 10*(-1) = 1
    
    Example 3:
    
    >>> isGoodArray(nums = [3,6])
    >>> false
    """
def oddCells(m: int, n: int, indices: List[List[int]]) -> int:
    """
    There is an m x n matrix that is initialized to all 0's. There is also a 2D array indices where each indices[i] = [ri, ci] represents a 0-indexed location to perform some increment operations on the matrix.
    For each location indices[i], do both of the following:
    
    Increment all the cells on row ri.
    Increment all the cells on column ci.
    
    Given m, n, and indices, return the number of odd-valued cells in the matrix after applying the increment to all locations in indices.
    
    Example 1:
    
    
    >>> oddCells(m = 2, n = 3, indices = [[0,1],[1,1]])
    >>> 6
    Explanation: Initial matrix = [[0,0,0],[0,0,0]].
    After applying first increment it becomes [[1,2,1],[0,1,0]].
    The final matrix is [[1,3,1],[1,3,1]], which contains 6 odd numbers.
    
    Example 2:
    
    
    >>> oddCells(m = 2, n = 2, indices = [[1,1],[0,0]])
    >>> 0
    Explanation: Final matrix = [[2,2],[2,2]]. There are no odd numbers in the final matrix.
    """
def reconstructMatrix(upper: int, lower: int, colsum: List[int]) -> List[List[int]]:
    """
    Given the following details of a matrix with n columns and 2 rows :
    
    The matrix is a binary matrix, which means each element in the matrix can be 0 or 1.
    The sum of elements of the 0-th(upper) row is given as upper.
    The sum of elements of the 1-st(lower) row is given as lower.
    The sum of elements in the i-th column(0-indexed) is colsum[i], where colsum is given as an integer array with length n.
    
    Your task is to reconstruct the matrix with upper, lower and colsum.
    Return it as a 2-D integer array.
    If there are more than one valid solution, any of them will be accepted.
    If no valid solution exists, return an empty 2-D array.
    
    Example 1:
    
    >>> reconstructMatrix(upper = 2, lower = 1, colsum = [1,1,1])
    >>> [[1,1,0],[0,0,1]]
    Explanation: [[1,0,1],[0,1,0]], and [[0,1,1],[1,0,0]] are also correct answers.
    
    Example 2:
    
    >>> reconstructMatrix(upper = 2, lower = 3, colsum = [2,2,1,1])
    >>> []
    
    Example 3:
    
    >>> reconstructMatrix(upper = 5, lower = 5, colsum = [2,1,2,0,1,0,1,2,0,1])
    >>> [[1,1,1,0,1,0,0,1,0,0],[1,0,1,0,0,0,1,1,0,1]]
    """
def closedIsland(grid: List[List[int]]) -> int:
    """
    Given a 2D grid consists of 0s (land) and 1s (water).  An island is a maximal 4-directionally connected group of 0s and a closed island is an island totally (all left, top, right, bottom) surrounded by 1s.
    Return the number of closed islands.
    
    Example 1:
    
    
    >>> closedIsland(grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]])
    >>> 2
    Explanation:
    Islands in gray are closed because they are completely surrounded by water (group of 1s).
    Example 2:
    
    
    >>> closedIsland(grid = [[0,0,1,0,0],[0,1,0,1,0],[0,1,1,1,0]])
    >>> 1
    
    Example 3:
    
                   [1,0,0,0,0,0,1],
                   [1,0,1,1,1,0,1],
                   [1,0,1,0,1,0,1],
                   [1,0,1,1,1,0,1],
                   [1,0,0,0,0,0,1],
                   [1,1,1,1,1,1,1]]
    >>> closedIsland(grid = [[1,1,1,1,1,1,1],)
    >>> 2
    """
def maxScoreWords(words: List[str], letters: List[str], score: List[int]) -> int:
    """
    Given a list of words, list of  single letters (might be repeating) and score of every character.
    Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times).
    It is not necessary to use all characters in letters and each letter can only be used once. Score of letters 'a', 'b', 'c', ... ,'z' is given by score[0], score[1], ... , score[25] respectively.
    
    Example 1:
    
    >>> maxScoreWords(words = ["dog","cat","dad","good"], letters = ["a","a","c","d","d","d","g","o","o"], score = [1,0,9,5,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0])
    >>> 23
    Explanation:
    Score  a=1, c=9, d=5, g=3, o=2
    Given letters, we can form the words "dad" (5+1+5) and "good" (3+2+2+5) with a score of 23.
    Words "dad" and "dog" only get a score of 21.
    Example 2:
    
    >>> maxScoreWords(words = ["xxxz","ax","bx","cx"], letters = ["z","a","b","c","x","x","x"], score = [4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,10])
    >>> 27
    Explanation:
    Score  a=4, b=4, c=4, x=5, z=10
    Given letters, we can form the words "ax" (4+5), "bx" (4+5) and "cx" (4+5) with a score of 27.
    Word "xxxz" only get a score of 25.
    Example 3:
    
    >>> maxScoreWords(words = ["leetcode"], letters = ["l","e","t","c","o","d"], score = [0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0])
    >>> 0
    Explanation:
    Letter "e" can only be used once.
    """
def encode(num: int) -> str:
    """
    Given a non-negative integer num, Return its encoding string.\r
    \r
    The encoding is done by converting the integer to a string using a secret function that you should deduce from the following table:\r
    \r
    \r
    \r
     \r
    Example 1:\r
    \r
    \r
    >>> encode(num = 23\r)
    >>> "1000"\r
    \r
    \r
    Example 2:\r
    \r
    \r
    >>> encode(num = 107\r)
    >>> "101100"\r
    \r
    \r
     \r
    """
def findSmallestRegion(regions: List[List[str]], region1: str, region2: str) -> str:
    """
    You are given some lists of regions where the first region of each list includes all other regions in that list.
    Naturally, if a region x contains another region y then x is bigger than y. Also, by definition, a region x contains itself.
    Given two regions: region1 and region2, return the smallest region that contains both of them.
    If you are given regions r1, r2, and r3 such that r1 includes r3, it is guaranteed there is no r2 such that r2 includes r3.
    It is guaranteed the smallest region exists.
    
    Example 1:
    
    regions = [["Earth","North America","South America"],
    ["North America","United States","Canada"],
    ["United States","New York","Boston"],
    ["Canada","Ontario","Quebec"],
    ["South America","Brazil"]],
    region1 = "Quebec",
    region2 = "New York"
    >>> findSmallestRegion()
    >>> "North America"
    
    Example 2:
    
    >>> findSmallestRegion(regions = [["Earth", "North America", "South America"],["North America", "United States", "Canada"],["United States", "New York", "Boston"],["Canada", "Ontario", "Quebec"],["South America", "Brazil"]], region1 = "Canada", region2 = "South America")
    >>> "Earth"
    """
def generateSentences(synonyms: List[List[str]], text: str) -> List[str]:
    """
    You are given a list of equivalent string pairs synonyms where synonyms[i] = [si, ti] indicates that si and ti are equivalent strings. You are also given a sentence text.
    Return all possible synonymous sentences sorted lexicographically.
    
    Example 1:
    
    >>> generateSentences(synonyms = [["happy","joy"],["sad","sorrow"],["joy","cheerful"]], text = "I am happy today but was sad yesterday")
    >>> ["I am cheerful today but was sad yesterday","I am cheerful today but was sorrow yesterday","I am happy today but was sad yesterday","I am happy today but was sorrow yesterday","I am joy today but was sad yesterday","I am joy today but was sorrow yesterday"]
    
    Example 2:
    
    >>> generateSentences(synonyms = [["happy","joy"],["cheerful","glad"]], text = "I am happy today but was sad yesterday")
    >>> ["I am happy today but was sad yesterday","I am joy today but was sad yesterday"]
    """
def numberOfWays(numPeople: int) -> int:
    """
    You are given an even number of people numPeople that stand around a circle and each person shakes hands with someone else so that there are numPeople / 2 handshakes total.
    Return the number of ways these handshakes could occur such that none of the handshakes cross.
    Since the answer could be very large, return it modulo 109 + 7.
    
    Example 1:
    
    
    >>> numberOfWays(numPeople = 4)
    >>> 2
    Explanation: There are two ways to do it, the first way is [(1,2),(3,4)] and the second one is [(2,3),(4,1)].
    
    Example 2:
    
    
    >>> numberOfWays(numPeople = 6)
    >>> 5
    """
def shiftGrid(grid: List[List[int]], k: int) -> List[List[int]]:
    """
    Given a 2D grid of size m x n and an integer k. You need to shift the grid k times.
    In one shift operation:
    
    Element at grid[i][j] moves to grid[i][j + 1].
    Element at grid[i][n - 1] moves to grid[i + 1][0].
    Element at grid[m - 1][n - 1] moves to grid[0][0].
    
    Return the 2D grid after applying shift operation k times.
    
    Example 1:
    
    
    >>> shiftGrid(grid = [[1,2,3],[4,5,6],[7,8,9]], k = 1)
    >>> [[9,1,2],[3,4,5],[6,7,8]]
    
    Example 2:
    
    
    >>> shiftGrid(grid = [[3,8,1,9],[19,7,2,5],[4,6,11,10],[12,0,21,13]], k = 4)
    >>> [[12,0,21,13],[3,8,1,9],[19,7,2,5],[4,6,11,10]]
    
    Example 3:
    
    >>> shiftGrid(grid = [[1,2,3],[4,5,6],[7,8,9]], k = 9)
    >>> [[1,2,3],[4,5,6],[7,8,9]]
    """
def maxSumDivThree(nums: List[int]) -> int:
    """
    Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by three.
    
    Example 1:
    
    >>> maxSumDivThree(nums = [3,6,5,1,8])
    >>> 18
    Explanation: Pick numbers 3, 6, 1 and 8 their sum is 18 (maximum sum divisible by 3).
    Example 2:
    
    >>> maxSumDivThree(nums = [4])
    >>> 0
    Explanation: Since 4 is not divisible by 3, do not pick any number.
    
    Example 3:
    
    >>> maxSumDivThree(nums = [1,2,3,4,4])
    >>> 12
    Explanation: Pick numbers 1, 3, 4 and 4 their sum is 12 (maximum sum divisible by 3).
    """
def minPushBox(grid: List[List[str]]) -> int:
    """
    A storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations.
    The game is represented by an m x n grid of characters grid where each element is a wall, floor, or box.
    Your task is to move the box 'B' to the target position 'T' under the following rules:
    
    The character 'S' represents the player. The player can move up, down, left, right in grid if it is a floor (empty cell).
    The character '.' represents the floor which means a free cell to walk.
    The character '#' represents the wall which means an obstacle (impossible to walk there).
    There is only one box 'B' and one target cell 'T' in the grid.
    The box can be moved to an adjacent free cell by standing next to the box and then moving in the direction of the box. This is a push.
    The player cannot walk through the box.
    
    Return the minimum number of pushes to move the box to the target. If there is no way to reach the target, return -1.
    
    Example 1:
    
    
                   ["#","T","#","#","#","#"],
                   ["#",".",".","B",".","#"],
                   ["#",".","#","#",".","#"],
                   ["#",".",".",".","S","#"],
                   ["#","#","#","#","#","#"]]
    >>> minPushBox(grid = [["#","#","#","#","#","#"],)
    >>> 3
    Explanation: We return only the number of times the box is pushed.
    Example 2:
    
                   ["#","T","#","#","#","#"],
                   ["#",".",".","B",".","#"],
                   ["#","#","#","#",".","#"],
                   ["#",".",".",".","S","#"],
                   ["#","#","#","#","#","#"]]
    >>> minPushBox(grid = [["#","#","#","#","#","#"],)
    >>> -1
    
    Example 3:
    
                   ["#","T",".",".","#","#"],
                   ["#",".","#","B",".","#"],
                   ["#",".",".",".",".","#"],
                   ["#",".",".",".","S","#"],
                   ["#","#","#","#","#","#"]]
    >>> minPushBox(grid = [["#","#","#","#","#","#"],)
    >>> 5
    Explanation: push the box down, left, left, up and up.
    """
def minTimeToVisitAllPoints(points: List[List[int]]) -> int:
    """
    On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points.
    You can move according to these rules:
    
    In 1 second, you can either:
    
    
    move vertically by one unit,
    move horizontally by one unit, or
    move diagonally sqrt(2) units (in other words, move one unit vertically then one unit horizontally in 1 second).
    
    
    You have to visit the points in the same order as they appear in the array.
    You are allowed to pass through points that appear later in the order, but these do not count as visits.
    
    
    Example 1:
    
    
    >>> minTimeToVisitAllPoints(points = [[1,1],[3,4],[-1,0]])
    >>> 7
    Explanation: One optimal path is [1,1] -> [2,2] -> [3,3] -> [3,4] -> [2,3] -> [1,2] -> [0,1] -> [-1,0]
    Time from [1,1] to [3,4] = 3 seconds
    Time from [3,4] to [-1,0] = 4 seconds
    Total time = 7 seconds
    Example 2:
    
    >>> minTimeToVisitAllPoints(points = [[3,2],[-2,2]])
    >>> 5
    """
def countServers(grid: List[List[int]]) -> int:
    """
    You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column.
    
    Return the number of servers that communicate with any other server.
    
    Example 1:
    
    
    >>> countServers(grid = [[1,0],[0,1]])
    >>> 0
    Explanation: No servers can communicate with others.
    Example 2:
    
    
    >>> countServers(grid = [[1,0],[1,1]])
    >>> 3
    Explanation: All three servers can communicate with at least one other server.
    
    Example 3:
    
    
    >>> countServers(grid = [[1,1,0,0],[0,0,1,0],[0,0,1,0],[0,0,0,1]])
    >>> 4
    Explanation: The two servers in the first row can communicate with each other. The two servers in the third column can communicate with each other. The server at right bottom corner can't communicate with any other server.
    """
def suggestedProducts(products: List[str], searchWord: str) -> List[List[str]]:
    """
    You are given an array of strings products and a string searchWord.
    Design a system that suggests at most three product names from products after each character of searchWord is typed. Suggested products should have common prefix with searchWord. If there are more than three products with a common prefix return the three lexicographically minimums products.
    Return a list of lists of the suggested products after each character of searchWord is typed.
    
    Example 1:
    
    >>> suggestedProducts(products = ["mobile","mouse","moneypot","monitor","mousepad"], searchWord = "mouse")
    >>> [["mobile","moneypot","monitor"],["mobile","moneypot","monitor"],["mouse","mousepad"],["mouse","mousepad"],["mouse","mousepad"]]
    Explanation: products sorted lexicographically = ["mobile","moneypot","monitor","mouse","mousepad"].
    After typing m and mo all products match and we show user ["mobile","moneypot","monitor"].
    After typing mou, mous and mouse the system suggests ["mouse","mousepad"].
    
    Example 2:
    
    >>> suggestedProducts(products = ["havana"], searchWord = "havana")
    >>> [["havana"],["havana"],["havana"],["havana"],["havana"],["havana"]]
    Explanation: The only word "havana" will be always suggested while typing the search word.
    """
def numWays(steps: int, arrLen: int) -> int:
    """
    You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time).
    Given two integers steps and arrLen, return the number of ways such that your pointer is still at index 0 after exactly steps steps. Since the answer may be too large, return it modulo 109 + 7.
    
    Example 1:
    
    >>> numWays(steps = 3, arrLen = 2)
    >>> 4
    Explanation: There are 4 differents ways to stay at index 0 after 3 steps.
    Right, Left, Stay
    Stay, Right, Left
    Right, Stay, Left
    Stay, Stay, Stay
    
    Example 2:
    
    >>> numWays(steps = 2, arrLen = 4)
    >>> 2
    Explanation: There are 2 differents ways to stay at index 0 after 2 steps
    Right, Left
    Stay, Stay
    
    Example 3:
    
    >>> numWays(steps = 4, arrLen = 2)
    >>> 8
    """
def toHexspeak(num: str) -> str:
    """
    A decimal number can be converted to its Hexspeak representation by first converting it to an uppercase hexadecimal string, then replacing all occurrences of the digit '0' with the letter 'O', and the digit '1' with the letter 'I'. Such a representation is valid if and only if it consists only of the letters in the set {'A', 'B', 'C', 'D', 'E', 'F', 'I', 'O'}.
    Given a string num representing a decimal integer n, return the Hexspeak representation of n if it is valid, otherwise return "ERROR".
    
    Example 1:
    
    >>> toHexspeak(num = "257")
    >>> "IOI"
    Explanation: 257 is 101 in hexadecimal.
    
    Example 2:
    
    >>> toHexspeak(num = "3")
    >>> "ERROR"
    """
def removeInterval(intervals: List[List[int]], toBeRemoved: List[int]) -> List[List[int]]:
    """
    A set of real numbers can be represented as the union of several disjoint intervals, where each interval is in the form [a, b). A real number x is in the set if one of its intervals [a, b) contains x (i.e. a <= x < b).
    You are given a sorted list of disjoint intervals intervals representing a set of real numbers as described above, where intervals[i] = [ai, bi] represents the interval [ai, bi). You are also given another interval toBeRemoved.
    Return the set of real numbers with the interval toBeRemoved removed from intervals. In other words, return the set of real numbers such that every x in the set is in intervals but not in toBeRemoved. Your answer should be a sorted list of disjoint intervals as described above.
    
    Example 1:
    
    
    >>> removeInterval(intervals = [[0,2],[3,4],[5,7]], toBeRemoved = [1,6])
    >>> [[0,1],[6,7]]
    
    Example 2:
    
    
    >>> removeInterval(intervals = [[0,5]], toBeRemoved = [2,3])
    >>> [[0,2],[3,5]]
    
    Example 3:
    
    >>> removeInterval(intervals = [[-5,-4],[-3,-2],[1,2],[3,5],[8,9]], toBeRemoved = [-1,4])
    >>> [[-5,-4],[-3,-2],[4,5],[8,9]]
    """
def deleteTreeNodes(nodes: int, parent: List[int], value: List[int]) -> int:
    """
    A tree rooted at node 0 is given as follows:
    
    The number of nodes is nodes;
    The value of the ith node is value[i];
    The parent of the ith node is parent[i].
    
    Remove every subtree whose sum of values of nodes is zero.
    Return the number of the remaining nodes in the tree.
    
    Example 1:
    
    
    >>> deleteTreeNodes(nodes = 7, parent = [-1,0,0,1,2,2,2], value = [1,-2,4,0,-2,-1,-1])
    >>> 2
    
    Example 2:
    
    >>> deleteTreeNodes(nodes = 7, parent = [-1,0,0,1,2,2,2], value = [1,-2,4,0,-2,-1,-2])
    >>> 6
    """
def tictactoe(moves: List[List[int]]) -> str:
    """
    Tic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are:
    
    Players take turns placing characters into empty squares ' '.
    The first player A always places 'X' characters, while the second player B always places 'O' characters.
    'X' and 'O' characters are always placed into empty squares, never on filled ones.
    The game ends when there are three of the same (non-empty) character filling any row, column, or diagonal.
    The game also ends if all squares are non-empty.
    No more moves can be played if the game is over.
    
    Given a 2D integer array moves where moves[i] = [rowi, coli] indicates that the ith move will be played on grid[rowi][coli]. return the winner of the game if it exists (A or B). In case the game ends in a draw return "Draw". If there are still movements to play return "Pending".
    You can assume that moves is valid (i.e., it follows the rules of Tic-Tac-Toe), the grid is initially empty, and A will play first.
    
    Example 1:
    
    
    >>> tictactoe(moves = [[0,0],[2,0],[1,1],[2,1],[2,2]])
    >>> "A"
    Explanation: A wins, they always play first.
    
    Example 2:
    
    
    >>> tictactoe(moves = [[0,0],[1,1],[0,1],[0,2],[1,0],[2,0]])
    >>> "B"
    Explanation: B wins.
    
    Example 3:
    
    
    >>> tictactoe(moves = [[0,0],[1,1],[2,0],[1,0],[1,2],[2,1],[0,1],[0,2],[2,2]])
    >>> "Draw"
    Explanation: The game ends in a draw since there are no moves to make.
    """
def numOfBurgers(tomatoSlices: int, cheeseSlices: int) -> List[int]:
    """
    Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:
    
    Jumbo Burger: 4 tomato slices and 1 cheese slice.
    Small Burger: 2 Tomato slices and 1 cheese slice.
    
    Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].
    
    Example 1:
    
    >>> numOfBurgers(tomatoSlices = 16, cheeseSlices = 7)
    >>> [1,6]
    Explantion: To make one jumbo burger and 6 small burgers we need 4*1 + 2*6 = 16 tomato and 1 + 6 = 7 cheese.
    There will be no remaining ingredients.
    
    Example 2:
    
    >>> numOfBurgers(tomatoSlices = 17, cheeseSlices = 4)
    >>> []
    Explantion: There will be no way to use all ingredients to make small and jumbo burgers.
    
    Example 3:
    
    >>> numOfBurgers(tomatoSlices = 4, cheeseSlices = 17)
    >>> []
    Explantion: Making 1 jumbo burger there will be 16 cheese remaining and making 2 small burgers there will be 15 cheese remaining.
    """
def countSquares(matrix: List[List[int]]) -> int:
    """
    Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.
    
    Example 1:
    
    [
      [0,1,1,1],
      [1,1,1,1],
      [0,1,1,1]
    ]
    >>> countSquares(matrix =)
    >>> 15
    Explanation:
    There are 10 squares of side 1.
    There are 4 squares of side 2.
    There is  1 square of side 3.
    Total number of squares = 10 + 4 + 1 = 15.
    
    Example 2:
    
    [
      [1,0,1],
      [1,1,0],
      [1,1,0]
    ]
    >>> countSquares(matrix =)
    >>> 7
    Explanation:
    There are 6 squares of side 1.
    There is 1 square of side 2.
    Total number of squares = 6 + 1 = 7.
    """