29
lindows
6y

This guy who earns 20% more than me wrote a method to check which string of 2 is lexicographically smaller.

public boolean isSmaller(String s1, String s2) {
String [] temp = new String[2];
temp[0] = s1;
temp[1] = s2;
Collections.sort(temp);
if (temp[0].equalsIgnoreCase(s1)) {
return true;
}
else {
return false;
}
}

Comments
Add Comment