How to deal with the condition x=0 and n<0??


  • 0
    A

    It's a mathematical error if x=0 and n<0.
    My code just return 0 for every x=0 and was accepted


  • -1
    S

    According to 'My code just return 0 for every x=0 and was accepted', I believe you miss the test case x = 0, n = 0, not x=0, n<0.


Log in to reply
 

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