You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )
int getNode( SinglyLinkedListNode * _list , int _positionFromTail ){ assert(_list); auto nodeEnd = _list; while(_positionFromTail--){ nodeEnd = nodeEnd->next; assert(nodeEnd); } while(nodeEnd->next){ _list = _list->next; nodeEnd = nodeEnd->next; } return _list->data; }
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++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )