Scilab 6.0.2 

```
    function [a, ka] = srty(a, b, orien)
    // returns a values which are not in b

    // orien="r"|"c" added, including the hypermat case

    rhs = argn(2);

    // CHECKING INPUT ARGUMENTS
    // ========================
    if rhs < 2 | rhs > 3 then
        msg = gettext("%s: Wrong number of input argument(s): %d or %d expected.\n");
        error(msprintf(msg, "setdiff", 2, 3));
    end
    // Trivial case _whatever is b_
    if a==[]
        ka = []
        return
    end
    // orien
    if ~isdef("orien","l") then
        orien = 0
    elseif orien~="r" & orien~="c" & orien~=1 & orien~=2
        msg = gettext("%s: Argument #%d: Must be in the set {%s}.\n");
        error(msprintf(msg, "setdiff", 3, "''r'',''c'',1,2"));
    elseif orien=="c"
        orien = 2
    elseif orien=="r"
        orien = 1
    end
    if orien==1 & size(a,2)~=size(b,2) then
        msg = _("%s: Arguments #%d and #%d: Same numbers of columns expected.\n")
        error(msprintf(msg, "setdiff", 1, 2))
    end
    if orien==2 & size(a,1)~=size(b,1) then
        msg = _("%s: Arguments #%d and #%d: Same numbers of rows expected.\n")
        error(msprintf(msg, "setdiff", 1, 2))
    end

    // PROCESSING
    // ==========
    // "r" or "c"
    // ----------
    if orien then
        it = inttype(a)
        if ndims(a)>2 then
            a = serialize_hypermat(a, orien)
        elseif orien==2
            a = a.'
        end
        // Trivial case
        if b == [] then
            ka = 1:size(a,orien);
            if orien==1
                ka = ka'
            end
            return
        end
        if ndims(b)>2 then
            b = serialize_hypermat(b, orien)
        elseif orien==2
            b = b.'
        end
        [a, ka] = unique(a, "r")
        b = unique(b, "r")
        [c, kc] = gsort([[a iconvert(ones(a(:,1)),it)] ;
                         [b iconvert(ones(b(:,1))*2,it)]], "lr","i")
        k = find(or(c(1:$-1,1:$-1)~=c(2:$,1:$-1),"c") & c(1:$-1,$)==1)
        if c($,$)==1
            k = [k size(c,1)]
        end
        ka = ka(kc(k))
        // a = a(ka,:) // in initial order
        a = c(k,1:$-1)
        if orien==2
            ka = ka'
            a = a.'
        end
    else
        // by element
        // ----------
        [a,ka] = unique(a);
        na = size(a,"*");

        b = unique(b(:));

        [x,k] = gsort([a(:); b], "g", "i");
        d = find(x(2:$)==x(1:$-1));  //index of common entries in sorted table
        if d <> [] then
            k([d;d+1]) = [];
        end

        keep = find(k <= na);
        a = a(k(keep));
        ka = ka(k(keep));
    end
   endfunction

 function h = serialize_hypermat(h, orien)
    if orien==1 then
        dims = 1:ndims(h)
        dims([1 2]) = [2 1]
        h = permute(h, dims)
    end
    h = matrix(h, size(h,1), -1).
endfunction
a = [1,2,3,5,8];
b = [0,1,3,4,8,9,10];
k = 3; //indicated number
G = srty(a,b)
disp(G(G>k)) //Shows a number greater than the given

```

I am trying to build an algorithm for determining the number of elements belonging to the set A \ B (difference A-B) and more than the set value.

For instance:
A = {1,2,3,5,8}, B = {0,1,3,4,8,9,10} and the set value is 3. A \ B = {2,5}, but there is one element
greater than 3. This value is 5.

If anyone knows another solution to this assignment, I would not refuse help.

---

I also have JavaScript code, without searching for numbers larger than the given.

JavaScript

```
function diff_sort_arr(array_1,array_2)
{
    var n = array_1.length, m = array_2.length, i = 0, k = 0, j = 0, array_3 = [];
    while ((i < n) && (j < m)) // until we reached the end of the array 
    {
        if (array_1[i] == array_2[j])
        { 
            i++,j++;
        } else {
            if (array_1[i] < array_2[j]) {
                array_3[k] = array_1[i];
                k++;
                i++; // shift position in the first array
            } else {
                j++; // move the position in the second array
            }
        }
    }
    while (i < n) {
        array_3[k] = array_1[i];
        k++, i++;
    }
    return array_3;
} 

diff_sort_arr([1,2,3,5,8], [0,1,3,4,8,9,10]); // at the exit [2, 5]

```