public static bool isPalindromic(string s)
{
for (int i = 0, j = s.Length - 1; i < j; i++, j--)
{
if (s[i] != s[j])
{
return false;
}
}
return true;
}
Time complexity: O(n)
Space complexity: O(1)