Skip to content

Commit

Permalink
removed wrong version
Browse files Browse the repository at this point in the history
  • Loading branch information
fmt-Println-MKO committed Jul 9, 2015
1 parent 375af54 commit 2dc4c3a
Showing 1 changed file with 19 additions and 35 deletions.
54 changes: 19 additions & 35 deletions src/de/sunbits/codeeval/stringsandarrows/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,30 @@ public static void main(String[] args) {
String line;
while ((line = inputStream.readLine()) != null) {

int a1c = 0;
int a2c = 0;
int ca = 0;
char[] chars = line.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (a1c == a2c) {
if (chars[i] == a1[a1c]) {
a1c++;
} else if (chars[i] == a2[a2c]) {
a2c++;
}
} else if (a1c > 0) {
if (chars[i] == a1[a1c]) {
a1c++;
if (a1c == 5) {
ca++;
a1c = 1;
}
} else if (a1c == 1 && chars[i] == a1[a1c - 1]) {
int size = chars.length;
for (int i = 0; i < size - 4; i++) {

} else if (chars[i] == a2[a2c]) {
a1c = 0;
a2c++;
} else {
a1c = 0;
int j = 0;
for (; j < 5; j++) {
if (a1[j] != chars[i + j]) {
break;
}
} else if (a2c > 0) {
if (chars[i] == a2[a2c]) {
a2c++;
if (a2c == 5) {
ca++;
a2c = 1;
}
if (j == 5) {
ca++;
i += 3;
} else {
j = 0;
for (; j < 5; j++) {
if (a2[j] != chars[i + j]) {
break;
}
} else if (a2c == 2 && chars[i] == a2[a2c - 1]) {

} else if (chars[i] == a1[a1c]) {
a2c = 0;
a1c++;
} else {
a2c = 0;
}
if (j == 5) {
ca++;
i += 3;
}
}
}
Expand Down

0 comments on commit 2dc4c3a

Please sign in to comment.