/**
* struct ListNode {
* int val;
* struct ListNode *next;
* ListNode(int x) :
* val(x), next(NULL) {
* }
* };
*/
class Solution {
public:
vector<int> printListFromTailToHead(struct ListNode* head) {
vector<int> arr,arrTemp;
struct ListNode *st=head;
while(st){
arr.push_back(st->val);
st=st->next;
}
vector<int>::iterator start;
for(start=arr.end()-1;start!=arr.begin()-1;start--)
arrTemp.push_back(*start);
return arrTemp;
}
};