For the class photo everyone lines up from shortest to tallest. Write photo_line(heights): use sort from <algorithm> to put the heights in order, smallest first, and return them.
photo_line({150, 138, 145})→[138, 145, 150]photo_line({})→[]vector<int> photo_line(vector<int> heights)#include <algorithm>
#include <vector>
using namespace std;
vector<int> photo_line(vector<int> heights) {
// your code here: sort heights
return heights;
}
Run tries the examples. When they look right, Submit.