Longest Palindromic Substring - java passed OJ