You are viewing a single comment's thread. Return to all comments →
c++ solution:
int getNode(SinglyLinkedListNode* llist, int p) { stack<int> a; while (llist!=nullptr) { a.push(llist->data); llist = llist->next; } while (p>0) { a.pop(); p--; } return a.top(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
c++ solution: