@@ -0,0 +1,1412 @@
+// Given a string s, partition s such that every substring of the partition is a palindrome.%0A%0A// Return all possible palindrome partitioning of s.%0A%0A// For example, given s = %22aab%22,%0A// Return%0A%0A//   %5B%0A//     %5B%22aa%22,%22b%22%5D,%0A//     %5B%22a%22,%22a%22,%22b%22%5D%0A//   %5D%0A%0Apublic class Solution %7B%0A    public List%3CList%3CString%3E%3E partition(String s) %7B%0A        List%3CList%3CString%3E%3E result = new ArrayList%3CList%3CString%3E%3E();%0A        List%3CString%3E tempList = new ArrayList%3CString%3E();%0A%0A        if(s.length() %3C 1)%7B%0A        %09result.add(tempList);%0A        %09return result;%0A        %7D%0A%0A        dfs(result, tempList, s, 0);%0A%0A        return result;%0A    %7D%0A%0A    public void dfs(List%3CList%3CString%3E%3E result, List%3CString%3E tempList, String s, int index)%7B%0A    %09if(index == s.length())%7B%0A    %09%09List%3CString%3E match = new ArrayList%3CString%3E(tempList);%0A    %09%09result.add(match);%0A    %09%09return;%0A    %09%7D%0A    %09for(int i = index; i %3C= s.length(); i++)%7B%0A    %09%09String tempString = s.substring(index, i);%0A    %09%09if(isPalindrome(tempString))%7B%0A    %09%09%09tempList.add(tempString);%0A    %09%09%09dfs(result, tempList, s, i);%0A    %09%09%09tempList.remove(tempList.size() - 1);%0A    %09%09%7D%0A    %09%7D%0A    %7D%0A%0A    public boolean isPalindrome(String s)%7B%0A    %09if(s.length() == 0) return false;%0A    %09%0A        for(int i = 0, j = s.length() - 1; i %3C j; i++, j--)%7B%0A            if(s.charAt(i) == s.charAt(j))%7B%0A                continue;%0A            %7D%0A            return false;%0A        %7D%0A        %0A        return true;%0A    %7D%0A%7D

add palindrome partitioning i solution