I already know that we can sort string arrays numerically, by converting them to integer array then using Arrays.sort() or using any comparator.
So my question is if those strings are beyond the limit of integer or long int then how can we sort them. For example consider the following string array:
14829435897932384626433832795
4159265358979323846264338327
1937286535897932384626433832795296523
23746289
in those cases traditional comparator or any sorting method won't work because in turn they use integer (or any other datatype).
BigIntegerseems a better option specifically for cases where theStringcan start with a bunch of zeros, e.g.000133124953. Length comparison would be problematic here.