Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- for (let num of input){
- console.log(isPalindrom(num));
- }
- function isPalindrom (num) {
- let numAsString=num.toString();
- for (let i=0; i<numAsString.length/2; i++) {
- if (numAsString[i]!==numAsString[numAsString.length-1-i]) {
- return false;
- }
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment