function r_d(a) {
    "use strict";
    var b = a.slice(), //copy array
        i = 0,
        k = 0,
        length = b.length,
        j,
        buffer = [];

    //splicing same elements
    for (i; i < length; i++) {
        j = 0;
        for (j; j < length; j++) {
            if (i < j && b[j] === b[i]) {
                b.splice(j, 1, "deleted");
            }
        }
    }
    //removing "deleted" elements
    for (k; k < length; k++) {
        if (b[k] !== "deleted") {
            buffer.push(b[k]);
        }
    }
    //return reconstructed array
    return buffer;
}

@@ -342,19 +342,82 @@
  1, 
-%22
+j + %22 (
 deleted
+)
 %22);
+ //added token the %22original element + (deleted)%22 string
 %0A   
@@ -524,29 +524,85 @@
 if (
+!
 b%5Bk%5D
- !== %22deleted%22) %7B
+.toString().match(%22(deleted)%22)) %7B //if it matches the string %22(deleted)%22
 %0A   

Update lline 15 and 21