class Solution {
public:
vector<int> printListReversingly(ListNode* head) {
vector<int> res;
for(auto cur = head; cur; cur = cur -> next){
res.push_back(cur -> val);
}
reverse(res.begin(), res.end());
return res;
}
};