package leetcode;

/**
 * https://leetcode.com/problems/permutation-in-string/
 */
public class Problem567 {
    public boolean checkInclusion(String s1, String s2) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem567 prob = new Problem567();
        System.out.println(prob.checkInclusion("ab", "eidbaooo")); // true
        System.out.println(prob.checkInclusion("ab", "eidboaoo")); // false
    }
}

@@ -172,36 +172,834 @@
     
-// TODO%0A        return false
+return checkInclusion(s1.toCharArray(), 0, s1.length() - 1, s2);%0A    %7D%0A%0A    private static void swap(char%5B%5D chars, int i, int j) %7B%0A        if (j %3E= chars.length) %7B%0A            return;%0A        %7D%0A        char tmp = chars%5Bi%5D;%0A        chars%5Bi%5D = chars%5Bj%5D;%0A        chars%5Bj%5D = tmp;%0A    %7D%0A%0A    private static boolean checkInclusion(char%5B%5D chars, int left, int right, String string) %7B%0A        if (left == right) %7B%0A            if (string.contains(new String(chars))) %7B%0A                return true;%0A            %7D%0A        %7D%0A        boolean found = false;%0A        for (int i = left; i %3C= right; i++) %7B%0A            swap(chars, left, i);%0A            found %7C= checkInclusion(chars, left + 1, right, string);%0A            if (found) %7B%0A                return found;%0A            %7D%0A            swap(chars, left, i);%0A        %7D%0A        return found
 ;%0A  
@@ -1243,16 +1243,125 @@
 / false%0A
+        System.out.println(prob.checkInclusion(%22dinitrophenylhydrazine%22, %22acetylphenylhydrazine%22)); // false%0A
     %7D%0A%7D%0A

Update problem 567