Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is 0 the reverse of 1534236469 #2

Closed
sifatul opened this issue Aug 20, 2020 · 2 comments
Closed

Why is 0 the reverse of 1534236469 #2

sifatul opened this issue Aug 20, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@sifatul
Copy link
Owner

sifatul commented Aug 20, 2020

Reverse Integer [Easy]

How come the output is 0 instead of 1056389759 after reversing 1534236469??

Screenshot:

image

@sifatul sifatul added the help wanted Extra attention is needed label Aug 20, 2020
@sifatul sifatul changed the title reverse-integer [Easy] Why is the output 0 for input 1534236469 Why is 0 the reverse of 1534236469 Aug 20, 2020
@sifatul
Copy link
Owner Author

sifatul commented Aug 22, 2020

the question requires the output to be 0 when the result overflow Thus as 1534236469 overflows Integer.MAX_VALUE the output is 0;

@sifatul sifatul closed this as completed Aug 22, 2020
@MythicalMayhem
Copy link

the reverse number of 1534236469 is 9646324351 which is not a 32 bit integer

ps :
- a 32bit integer should be less than 4,294,967,296 which is (2^32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants