Python Integer Break 44ms


  • -1
    Q

    class Solution(object):
    def integerBreak(self, n):
    if n in[1,2,3]:
    return n-1
    if n==4:
    return n
    result=1
    while n>4:
    n=n-3
    result=result3
    result=result
    n
    return result


Log in to reply
 

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