@@ -0,0 +1,1684 @@
+package no005.longest.palindrom.substring;%0A%0A/**%0A * Created by jsong on 28/03/2018.%0A *%0A * @hackerrank https://www.hackerrank.com/jsong00505%0A * @backjoon https://www.acmicpc.net/user/jsong00505%0A * @github https://github.com/jsong00505%0A * @linkedin https://www.linkedin.com/in/junesongskorea/%0A * @leetcode https://leetcode.com/jsong00505/%0A * @email jsong00505@gmail.com%0A * @challenge Longest Palindrome Substring%0A */%0Apublic class Solution %7B%0A%0A  /**%0A   * Validate if the substring of s is a palindrome string between supplied indexs.%0A   *%0A   * @param s A string%0A   * @param start A start index%0A   * @param end A end index%0A   * @return %7B@link true%7D If it is a plindrome string of %7B@link false%7D if not. If the length is 1 it%0A   *     treats as like a palindrome string.%0A   */%0A  public static boolean isPalindrome(String s, int start, int end) %7B%0A    int length = end - start + 1;%0A    if (length == 1) %7B%0A      return true;%0A    %7D%0A    if (s.charAt(start) == s.charAt(end)) %7B%0A      return length == 2 %7C%7C isPalindrome(s, start + 1, end - 1);%0A    %7D%0A    return false;%0A  %7D%0A%0A  public static String longestPalindrome(String s) %7B%0A    int length = s.length();%0A    for (int i = length - 1; i %3E 0; i--) %7B%0A      for (int j = 0; j %3C= length - i - 1; j++) %7B%0A        if (isPalindrome(s, j, i + j)) %7B%0A          return s.substring(j, j + i + 1);%0A        %7D%0A      %7D%0A    %7D%0A    return s.substring(0, 1);%0A  %7D%0A%0A  public static void main(String%5B%5D args) %7B%0A    System.out.println(%22bab%22.equals(longestPalindrome(%22babad%22)));%0A    System.out.println(%22aba%22.equals(longestPalindrome(%22aba%22)));%0A    System.out.println(%22bb%22.equals(longestPalindrome(%22cbbd%22)));%0A    System.out.println(%22a%22.equals(longestPalindrome(%22abcde%22)));%0A  %7D%0A%7D%0A

solved Longest Palindrome Substring