Hard
Sorted Horizontal Bars
Read names and values. Sort them by value (smallest first; ties keep input order) and draw a horizontal bar chart (
barh). Print the names in plotted order and the widths of the bars as ints.Input
Two lines.
Output
Two lines.
Sample 1
Input
Dhaka Sylhet Khulna 2350 1100 750
Output
Khulna Sylhet Dhaka [750, 1100, 2350]
Sample 2
Input
A 1
Output
A [1]
Output appears here