@@ -0,0 +1,1046 @@
+import org.jetbrains.annotations.NotNull;%0A%0A/**%0A * PROBLEM%0A * Write an efficient function that deletes characters from an ASCII string. Use the prototype%0A * string removeChars (string str, string remove);%0A * where any character existing in remove must be dleted from str.%0A */%0Apublic class RemovedSpecifiedCharacters %7B%0A    @NotNull%0A    public static String removeChars (String str, String remove) %7B%0A        char%5B%5D s = str.toCharArray();%0A        char%5B%5D r = remove.toCharArray();%0A        int src, dst = 0;%0A%0A        // flags automatically initialized to false, size of 128 assumes ASCII%0A        boolean%5B%5D flags = new boolean%5B128%5D;%0A%0A        // Set flags for characters to be removed%0A        for (src = 0; src %3C r.length; ++src) %7B%0A            flags%5Br%5Bsrc%5D%5D = true;%0A        %7D%0A%0A        // Now loop through all the characters,%0A        // copying only if they aren't flagged%0A        for (src = 0; src%3Cs.length; ++src) %7B%0A            if (!flags%5Bs%5Bsrc%5D%5D) %7B%0A                s%5Bdst++%5D = s%5Bsrc%5D;%0A            %7D%0A        %7D%0A        return new String(s,0,dst);%0A    %7D%0A%7D%0A

Remove Specified Characters.