Sort Dates

easy
1. You are given an array(arr) of different dates in format DD-MM-YYYY.
2. You have to sort these dates in increasing order.

Input Format

An Integer N arr1 arr2.. n integers

Output Format

Check the sample output and question video.

Constraints

1 <= N <= 10000
All dates are between year 0 to year 2500

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
5
12041996
20101996
05061997
12041989
11081987
Output
11081987
12041989
12041996
20101996
05061997
Previous
Radix Sort
Next
Sort 01

Related Questions