HackerRank - 'Sort' command #6
April - 25/2025Problem:
You are given a file of tab separated weather data (TSV). There is no header column in this data file.
# Input
- Albany, N.Y. 22.2 46.6 71.1 49.3 38.60 136 64.4 57
- Albuquerque, N.M. 35.7 55.6 78.5 57.3 9.47 60 11.0 64
- ...
# Output
- Bismarck, N.D. 10.2 43.3 70.4 45.2 16.84 96 44.3 64
- Anchorage, Alaska 15.8 36.3 58.4 34.1 16.08 115 70.8 39 / 60
- ...
# Solution
sort -n -k 2 -t $'\t'