We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
intGetNode(Nodehead,intn){// This is a "method-only" submission. // You only need to complete this method. Nodecurr=head;for(inti=0;i<n;i++){head=head.next;}while(head.next!=null){head=head.next;curr=curr.next;}returncurr.data;}
Cookie support is required to access HackerRank
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 →
simple java solution based on this algorithm