Mindera Interview Question

How would you check if a string is a palindrome?

Interview Answers

Anonymous

Jan 1, 2019

public static bool IsPallindrome(string input) { string revs=""; for (int i = input.Length-1; i >=0; i--) { revs += input[i].ToString(); } if (revs == input) { return true; } return false; }

Anonymous

Aug 4, 2019

what about? const checkPalindrome = string => string.split("").reverse().join("").toLowerCase() === string.toLowerCase()