🔹 Day 3: Palindrome Number (LeetCode #9) 📌 Problem Statement: Given an integer x, return true if x is a palindrome, and false otherwise. (A palindrome is a number that reads the same forward and ...
The core idea of a palindrome is symmetry—it reads the same forwards and backward. For a number like 121, this is straightforward. The challenge comes from verifying this property without converting ...
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 ...
// Given an integer x, return true if x is a palindrome, and false otherwise. // Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.