public static boolean isInterleaved(String a, String b, String c)
    {
        if (a.isEmpty() && b.isEmpty() && c.isEmpty())
        {
            return true;
        }
        
        if (c.isEmpty())
        {
            return false;
        }
        
        return ((c.charAt(0) == a.charAt(0) && 
                isInterleaved(a.substring(1), b, c.substring(1)))
                || (c.charAt(0) == b.charAt(0) && 
                isInterleaved(a, b.substring(1), c.substring(1))));
    }