// Complete the C++ function
//Sort a stack using an auxiliary stack. Return thesortedstack.
#include <stack>
#include <vector>
using namespace std;
stack<int> sortStack(stack<int> s) {
// Code goes here
}
vector<int> stackWrapper(vector<int> v) {
stack<int> s;
for (auto el : v) {
s.push(el);
}
stack<int> r = sortStack(s);
vector<int> updated = {};
while(!r.empty()) {
updated.insert(updated.begin(), r.top());
r.pop();
}
return updated;
}
Expert Answer
An answer will be send to you shortly. . . . .