Skip to content

Instantly share code, notes, and snippets.

@limbalrings
Created November 30, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save limbalrings/23154b75347054d513f21031f2858ab5 to your computer and use it in GitHub Desktop.
Save limbalrings/23154b75347054d513f21031f2858ab5 to your computer and use it in GitHub Desktop.
code read sample
\\ ********
\\ Sample #1
\\ ********
public static String noName1(String content, String stuff) {
for (int i = 0; i < stuff.length(); i++) {
for (int j = content.length() - 1; j >= 0; j--) {
if (stuff.charAt(i) == content.charAt(j)) {
content = utilityFunction(content, 0, j) +
utilityFunction(content, j + 1, content.length() - (j + 1));
continue;
}
}
}
return content;
}
static String utilityFunction(String s, int off, int len) {
char[] n = new char[len];
for (int i = 0; i < len; i++) {
n[i] = s.charAt(i+off);
}
return new String(n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment