Edit:
I managed to take a different approach which seems to work in all cases:
public static int temprovichDistance(String referenceString, String comparisonString) {
if (referenceString == null || comparisonString == null) return -1;
if (referenceString.equals(comparisonString)) return 0;
if (referenceString.length() == 0 || comparisonString.length() == 0) return -1;
int dist = 0;
for (int i = 0; i < referenceString.length(); i++) {
int tmp = 0;
for (int j = 0; j < comparisonString.length(); j++) {
if (referenceString.charAt(i) != comparisonString.charAt(j)) tmp++;
else continue;
}
if (tmp == comparisonString.length()) dist++;
}
return dist == 0 ? dist + Mathf.abs(referenceString.length() - comparisonString.length()) : dist;
}
Thanks again for any comments <3