Python tricky solution


  • 0
    J

    I know it's kind of cheating. But think about it...

    def numberOfPatterns(self, m, n):
            """
            :type m: int
            :type n: int
            :rtype: int
            """
            lst = [9, 56,320,1624,7152,26016,72912,140704,140704]
            return sum(lst[m-1:n])
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.