Skip to content

Instantly share code, notes, and snippets.

@peijiehu
Created December 9, 2017 18:32
Show Gist options
  • Save peijiehu/e5f92b0c4a716762e9bf308d3dad7dac to your computer and use it in GitHub Desktop.
Save peijiehu/e5f92b0c4a716762e9bf308d3dad7dac to your computer and use it in GitHub Desktop.
sign = -1 if ls[0] == '-' else 1
max(-2**31, min(2**31-1, sign * res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment