• + 0 comments

    JS Recusrive solution:

    function reverse(llist) {
        if (!llist || !llist.next) {
         return llist;
       }
    
       let newHead = reverse(llist.next);
       llist.next.next = llist;
       llist.next = null;
     
       return newHead;
    }