Well, when comparing strings lexicographically, longer string doesn't necessarily mean a "larger" string in lexicographic sense. For example "zzz" > "aaaaaa" even though it's shorter. What I do now is check if the two arrays are equal element-wise up until the end of the shorter string, if they are then the longer string "wins".