Oct 1, 2021
after using abs I go ahead to do checks below:
if output >= 2** 31 -1 or output <= -2** 31:
return 0
elif n < 0:
return -1 * output
else:
return output
after using abs I go ahead to do checks below:
if output >= 2** 31 -1 or output <= -2** 31:
return 0
elif n < 0:
return -1 * output
else:
return output
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app
Software engineer. I write about my journey, Machine Learning, Web application development and also Python!