-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create PalindromeNumber.java #64
Conversation
Reviewer's Guide by SourceryThis PR introduces two new Java classes: one for checking palindrome numbers and another for printing matrix diagonals. The palindrome checker implements LeetCode question #9 using a straightforward digit reversal approach, while the matrix diagonal printer uses nested loops to traverse and print diagonal elements. Class diagram for the new Java classesclassDiagram
class Solution {
+boolean isPalindrome(int x)
}
class PrintDiagonalElements {
+main(String[] args)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SayedZahur786 - I've reviewed your changes - here's some feedback:
Overall Comments:
- This PR contains two unrelated changes (PalindromeNumber and PrintMatrixDiagonal). Please split these into separate pull requests for better review and version control.
- The class name 'PrintDiagonalElements' doesn't match its file name 'PrintMatrixDiagonal.java'. Please ensure the class name matches the file name for consistency.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Java/PalindromeNumber.java
Outdated
|
||
while (x > 0) { | ||
int digit = x % 10; | ||
reversed = reversed * 10 + digit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Potential integer overflow when reversing numbers close to Integer.MAX_VALUE.
Consider adding overflow detection or using long to handle larger numbers safely.
Sir My Code is correct I don't know why it's failing the check Please merge it |
Wrote a Boolean function program for checking wether a number is Palindrome or not also solution of leetcode Q9
Summary by Sourcery
Introduce two new Java programs: one for printing diagonal elements of a matrix and another for checking if a number is a palindrome.
New Features: