From 04a0eb54fac1762e1fb9b432c9be09b32ae9f4f9 Mon Sep 17 00:00:00 2001 From: yubin <59639035+gogumaC@users.noreply.github.com> Date: Sat, 4 Jan 2025 16:41:46 +0900 Subject: [PATCH] Delete 0009-palindrome-number directory --- .../0009-palindrome-number.c | 29 --------------- 0009-palindrome-number/README.md | 36 ------------------- 2 files changed, 65 deletions(-) delete mode 100644 0009-palindrome-number/0009-palindrome-number.c delete mode 100644 0009-palindrome-number/README.md diff --git a/0009-palindrome-number/0009-palindrome-number.c b/0009-palindrome-number/0009-palindrome-number.c deleted file mode 100644 index 6b85f4b..0000000 --- a/0009-palindrome-number/0009-palindrome-number.c +++ /dev/null @@ -1,29 +0,0 @@ -bool isPalindrome(int x) { - - int len = 0; - int xx = x; - do - { - xx/=10; - len++; - }while(xx); - - if(x<0) - { - len++; - } - - char str[len+1]; - sprintf(str,"%d",x); - - for(int i=0; i<=len/2; i++) - { - if(str[i]!=str[len-i-1]) - { - return false; - } - } - - return true; - -} \ No newline at end of file diff --git a/0009-palindrome-number/README.md b/0009-palindrome-number/README.md deleted file mode 100644 index 6fa224a..0000000 --- a/0009-palindrome-number/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
Given an integer x
, return true
if x
is a palindrome, and false
otherwise.
-
Example 1:
- --Input: x = 121 -Output: true -Explanation: 121 reads as 121 from left to right and from right to left. -- -
Example 2:
- --Input: x = -121 -Output: false -Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. -- -
Example 3:
- --Input: x = 10 -Output: false -Explanation: Reads 01 from right to left. Therefore it is not a palindrome. -- -
-
Constraints:
- --231 <= x <= 231 - 1
-Follow up: Could you solve it without converting the integer to a string? \ No newline at end of file