标签:rev solution -- 最大 ack ras nts tor element
class Solution {
public:
vector<int> replaceElements(vector<int>& arr) {
vector<int>v;
int ans=0;
for(int i=arr.size()-1;i>=0;i--)
{
ans=max(ans,arr[i]);
v.push_back(ans);
}
reverse(v.begin(),v.end());
v.erase(v.begin(),v.begin()+1);
v.push_back(-1);
return v;
}
};
标签:rev solution -- 最大 ack ras nts tor element
原文地址:https://www.cnblogs.com/Vampire6/p/13195479.html