Given a vector of arrays, the task is to sort them.
Input: [[1, 2, 3], [10, 20, 30], [30, 60, 90], [10, 20, 10]]
Output: [[1, 2, 3], [10, 20, 10], [10, 20, 30], [30, 60, 90]]
Input: [[7, 2, 9], [5, 20, 11], [6, 16, 19]]
Output: [[5, 20, 11], [6, 16, 19], [7, 2, 9]]
In this problem, sort() function takes two arguments first(begin position of the vector) and second(end position of the vector) to sorts a vector of arrays (items with random access). Below is a simple program to show the working of sort().