Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
yummyummy solution in Clear category for Reverse Integer by viktor.chyrkin
def reverse_digits(num: int) -> int:
d = 0
if str(num)[0] == '-':
d = 2
num = str(num)[1:]
num = str(num)
return int(num[::-1]) - int(num[::-1]) * d
Nov. 14, 2023