3 ms·Nice one there! sort is an elegant solution even tho the time complexity may be O(nlogn).by daiyanze 6y agoNice one there! sort is an elegant solution even tho the time complexity may be O(nlogn).