const isPalindrome = (str) => {
const preprocessing_regex = /[^a-zA-Z0-9]/g,
processed_string = str.toLowerCase().replace(preprocessing_regex , ""),
integrity_check = processed_string.split("").reverse().join("");
if(processed_string === integrity_check) return true
else return false
}
//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
class Solution {
public:
bool isPalindrome(int x) {
}
};
let data = 12421
const dataOne = data.toString().split("").reverse().join("");
data = data.toString();
dataOne === data ? console.log("Palindrom")
: console.log("Not Palindorm");
var isPalindrome = function(x) {
let y = x
let r = y.toString().split('').reverse().join('')
let t = Number(r)
if(t ===x){
return true
}
else{
return false}
}
while(n>0){
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
class Solution {
public boolean isPalindrome(int x) {
}
}
public class Solution {
public bool IsPalindrome(int x) {
}
}
/**
* @param {number} x
* @return {boolean}
*/
var isPalindrome = function(x) {
};
# @param {Integer} x
# @return {Boolean}
def is_palindrome(x)
end
class Solution {
func isPalindrome(_ x: Int) -> Bool {
}
}
class Solution {
/**
* @param Integer $x
* @return Boolean
*/
function isPalindrome($x) {
}
}
171, 181, 191, 202
function isPalindrome(x: number): boolean {
};
bool isPalindrome(int x){
}
Code Example |
---|
Cpp :: concatenate 2 vectors in c++ |
Cpp :: default access specifier in c++ |
Cpp :: c++ variables |
Cpp :: Set Specific Time in youtube Video url |
Cpp :: c++ do you not inherit constructor |
Cpp :: vector to char array c++ |
Cpp :: constructor overloading in c++ |
Cpp :: what does | mean in c++ |
Cpp :: c++ press any key |
Cpp :: call by value in c++ |
Cpp :: c++ pwstr to char* |
Cpp :: make an x using asterisk c++ |
C :: stop redis server |
C :: fahrenheit to celsius formula |
C :: install gitk mac |
C :: find maximum number between 3 numbers in c |
C :: printf boo; |
C :: simplify fractions C |
C :: If statement that tests if a value is in range |
C :: random in c |
C :: scan numbers into array c |
C :: va_list in c |
C :: stdio |
C :: how to check if a string pointer is empty in c |
C :: dynamic memory in c |
C :: c to llvm |
C :: what is the usage of extern in c |
C :: bitwise and in c |
C :: selection sort algorithm in c |
C :: how to read 2d array from a file in c |