Skip to main content
updated to not include comparison operators
Source Link

Java - 162162 147 characters

The idea is to compare the difference of each byte, same bytes will have difference 0. The program will throw java.lang.ArrayIndexOutOfBoundsException for when bytes are different (try to access a negative index) or when strings are of different length. It will catch the exception and return 0 (strings not equal), or return 1 otherwise (strings equal).

Compressed:

String a = "12345";
String b = "12345";
byte[]x=a.getBytes(),y=b.getBytes();int c=az,i=a.length(),d=b-b.length(),z,i=0;try;try{for(;i<(c>d?c:byte d);i++:x){z=(x[i]z=d-y[i]);z=x[y[i];z=x[-z*z];z*z];i++;}}catch(Exception e){return 0;}return 1;

Normal:

String a = "12345";
String b = "12345";
 
byte[] byteArrA = a.getBytes();
byte[] byteArrB = b.getBytes();

int aLenbyteDifference = 0;
int i = a.length();
int bLen =- b.length();
 
int byteDifference = 0;
try {
    for (int i = 0; i < (aLen > bLen ?byte aLenaByte : bLen); i++byteArrA) {
        byteDifference = (byteArrA[i]aByte - byteArrB[i]);byteArrB[i];
        byteDifference = byteArrA[-byteDifference*byteDifference];
        i++;
    }
} catch (Exception e){
    return 0;
}

return 1;

Java - 162 characters

The idea is to compare the difference of each byte, same bytes will have difference 0. The program will throw java.lang.ArrayIndexOutOfBoundsException for when bytes are different (try to access a negative index) or when strings are of different length. It will catch the exception and return 0 (strings not equal), or return 1 otherwise (strings equal).

Compressed:

String a = "12345";
String b = "12345";
byte[]x=a.getBytes(),y=b.getBytes();int c=a.length(),d=b.length(),z,i=0;try{for(;i<(c>d?c:d);i++){z=(x[i]-y[i]);z=x[-z*z];}}catch(Exception e){return 0;}return 1;

Normal:

String a = "12345";
String b = "12345";
 
byte[] byteArrA = a.getBytes();
byte[] byteArrB = b.getBytes();

int aLen = a.length();
int bLen = b.length();
 
int byteDifference = 0;
try {
    for (int i = 0; i < (aLen > bLen ? aLen : bLen); i++) {
        byteDifference = (byteArrA[i] - byteArrB[i]);
        byteDifference = byteArrA[-byteDifference*byteDifference];
    }
} catch (Exception e){
    return 0;
}

return 1;

Java - 162 147 characters

The idea is to compare the difference of each byte, same bytes will have difference 0. The program will throw java.lang.ArrayIndexOutOfBoundsException for when bytes are different (try to access a negative index) or when strings are of different length. It will catch the exception and return 0 (strings not equal), or return 1 otherwise (strings equal).

Compressed:

String a = "12345";
String b = "12345";
byte[]x=a.getBytes(),y=b.getBytes();int z,i=a.length()-b.length();try{for(byte d:x){z=d-y[i];z=x[-z*z];i++;}}catch(Exception e){return 0;}return 1;

Normal:

String a = "12345";
String b = "12345";
byte[] byteArrA = a.getBytes();
byte[] byteArrB = b.getBytes();

int byteDifference = 0;
int i = a.length() - b.length();

try {
    for (byte aByte : byteArrA) {
        byteDifference = aByte - byteArrB[i];
        byteDifference = byteArrA[-byteDifference*byteDifference];
        i++;
    }
} catch (Exception e){
    return 0;
}

return 1;
Source Link

Java - 162 characters

The idea is to compare the difference of each byte, same bytes will have difference 0. The program will throw java.lang.ArrayIndexOutOfBoundsException for when bytes are different (try to access a negative index) or when strings are of different length. It will catch the exception and return 0 (strings not equal), or return 1 otherwise (strings equal).

Compressed:

String a = "12345";
String b = "12345";
byte[]x=a.getBytes(),y=b.getBytes();int c=a.length(),d=b.length(),z,i=0;try{for(;i<(c>d?c:d);i++){z=(x[i]-y[i]);z=x[-z*z];}}catch(Exception e){return 0;}return 1;

Normal:

String a = "12345";
String b = "12345";

byte[] byteArrA = a.getBytes();
byte[] byteArrB = b.getBytes();

int aLen = a.length();
int bLen = b.length();

int byteDifference = 0;
try {
    for (int i = 0; i < (aLen > bLen ? aLen : bLen); i++) {
        byteDifference = (byteArrA[i] - byteArrB[i]);
        byteDifference = byteArrA[-byteDifference*byteDifference];
    }
} catch (Exception e){
    return 0;
}

return 1;