@@ -0,0 +1,1334 @@
+// Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.%0A%0A// For example,%0A// Given:%0A// s1 = %22aabcc%22,%0A// s2 = %22dbbca%22,%0A%0A// When s3 = %22aadbbcbcac%22, return true.%0A// When s3 = %22aadbbbaccc%22, return false.%0A%0Apublic class Solution %7B%0A    public boolean isInterleave(String s1, String s2, String s3) %7B%0A        if(s1.length() + s2.length() != s3.length()) return false;%0A%0A        boolean%5B%5D%5B%5D matched = new boolean%5Bs1.length() + 1%5D%5Bs2.length() + 1%5D;%0A        matched%5B0%5D%5B0%5D = true;%0A%0A        for(int i = 1; i %3C= s1.length(); i++)%7B%0A        %09if(s1.charAt(i - 1) == s3.charAt(i - 1))%7B%0A        %09%09matched%5Bi%5D%5B0%5D = true;%0A        %09%7Delse break;%0A        %7D%0A%0A        for(int i = 1; i %3C= s2.length(); i++)%7B%0A        %09if(s2.charAt(i - 1) == s3.charAt(i - 1))%7B%0A        %09%09matched%5B0%5D%5Bi%5D = true;%0A        %09%7Delse break;%0A        %7D%0A%0A        for(int i1 = 1; i1 %3C= s1.length(); i1++)%7B%0A        %09char c1 = s1.charAt(i1 - 1);%0A        %09for(int i2 = 1; i2 %3C= s2.length(); i2++)%7B%0A        %09%09char c2 = s2.charAt(i2 - 1);%0A        %09%09int i3 = i1 + i2;%0A        %09%09boolean fromS1 = (s1.charAt(i1 - 1) == s3.charAt(i3 - 1)) && matched%5Bi1 - 1%5D%5Bi2%5D;%0A        %09%09boolean fromS2 = (s2.charAt(i2 - 1) == s3.charAt(i3 - 1)) && matched%5Bi1%5D%5Bi2 - 1%5D;%0A        %09%09matched%5Bi1%5D%5Bi2%5D = fromS1 %7C%7C fromS2;%0A        %09%7D%0A        %7D%0A%0A        return matched%5Bs1.length()%5D%5Bs2.length()%5D;%0A    %7D%0A%7D%0A

add interleaving string solution