Recursive solution:
function printLinkedList(head) {
if(!head) return;
console.log(head.data);
printLinkedList(head.next);
}
I'm solving this problem in JS
https://www.hackerrank.com/challenges...
* It's just a way for me to keep solving questions... *
My Profile :
https://www.hackerrank.com/rowad