Skip to content

Commit a9e1d9f

Browse files
author
cpppy
authored
Update and rename 160_Intersection_of_Two_Linked_Lists.cc to 9_Palindrome_Number.cc
1 parent ded340e commit a9e1d9f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

9_Palindrome_Number.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public:
3+
bool isPalindrome(int x) {
4+
int oldx=x;
5+
int y = 0;
6+
while(x>0){
7+
y=y*10+(x%10);
8+
x=x/10;
9+
}
10+
return oldx==y;
11+
}
12+
};

0 commit comments

Comments
 (0)