How would you write a Java program to check if a string is a palindrome?
By converting the string to an array of characters and comparing each character from the start and end of the array.
You're close, but converting the string to a character array may use extra space. You can achieve the same without it.
Can you implement a version that compares characters directly from the string using indices?