I don't understand my code is not working for this small question


  • 0
    H

    """

    I am getting this error:

    #Runtime Error Message:
    #Line 9: MemoryError ; line 9 is for i in range(a):
    #Last executed input:
    #2147483647
    #-2147483648

    class Solution(object):
    def getSum(self, a, b):
    """
    :type a: int
    :type b: int
    :rtype: int
    """
    lst = []
    for i in range(a):
    lst.append(1)
    for i in range(b):
    lst.append(1)
    return len(lst)
    """


Log in to reply
 

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