Skip to content

Commit 475e6f8

Browse files
Palindrome number first solution inefficient 0(n2)
1 parent b5b2e95 commit 475e6f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

leetcode/PalindromeNumber.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function isPalindrome(x) {
2+
const s = Number(String(x).split("").reverse().join(""));
3+
return x === s;
4+
}
5+
//My first iteration over Palindrome number, quadratic time complexity 0(n2)

0 commit comments

Comments
 (0)