Lab 3.1.1 sort and count
You cannot submit for this problem because the homework's deadline is due.
Description
Use python3 or OCmal to implement sort and count algorithm.
Submission Format
Submit a tar or zip file including a script named sortcount.py
or sortcount.ml
.
IO
Input
A line of numbers, separated by single space.
Output
Two lines.
The first line is the count of inversions.
The second line is the sorted results.
Sample IO
input
3 4 2 1
output
5
[1, 2, 3, 4]