Skip to content

Conversation

amarchourasia98
Copy link

No description provided.

x /= 10;
if (rev > Integer.MAX_VALUE/10 || (rev == Integer.MAX_VALUE / 10 && pop > 7)) return 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to explain 7 and -8 with comments.

res = res * 10 + x % 10;
if (res > Integer.MAX_VALUE || res < Integer.MIN_VALUE)
return 0;
int pop = x % 10;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you can comment original solution (which is very concise), and add this new solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants