clear input for uniqueSort after sorting to prevent memory leak

The sortInput makes memory leakage for last sorting.
I have found memory leakage while using jQuery.