How could this code figure out the sign bit like '+' and '-' and put it at the beginning of result?


  • 0
    G

    I dont under stant that if you use '^[+-0]', it should fillter out the signal bit in the str and return a str with no signal bit. Then the code return the result = int(''.join(str)) directly. How could the result contain the signal bits like '+' and '-' after re.findall()?


Log in to reply
 

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