After the race, times holds everyone's time in seconds. Only the three fastest stand on the podium. Write podium(times): sort fastest first and keep just the first 3; with fewer than 3 runners, keep them all.
podium({58, 52, 61, 55})→[52, 55, 58]podium({70, 65})→[65, 70]vector<int> podium(vector<int> times)#include <algorithm>
#include <vector>
using namespace std;
vector<int> podium(vector<int> times) {
// your code here: sort, keep the first 3
return times;
}
Run tries the examples. When they look right, Submit.