Glassdoor interview question

Sort user inputs depending of the values, and display in DOM