Challenge: Let's Play with Containers

Complete this hands-on exercise to test your knowledge.

Problem statement

You are given an input consisting of key/value pairs, where each key is an integer, and each value is an integer.

Write a function that reads the input from a user and stores it in a map of vectors. Then, you need to sort the corresponding vector in ascending order for each key in the map. Finally, you need to output the sorted map.

Input

The key represents an integer; the value can be either a single integer or a vector of integers enclosed in curly braces {}. Commas separate the vector elements.

Get hands-on with 1200+ tech skills courses.