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.
To those who didn't get it, he's exploiting the constructor parameters to create another list entirely.
And this one will be reversed because he's setting the 'next' pointer (reference) of each node as the previous node.
Legit coding master approach up there.
I did my iterative amateurish thingy, then came here and foung his solution. Mine doesn't ever look pythonic.
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
Boy, oh boy. You crushed it.
To those who didn't get it, he's exploiting the constructor parameters to create another list entirely. And this one will be reversed because he's setting the 'next' pointer (reference) of each node as the previous node. Legit coding master approach up there.
I did my iterative amateurish thingy, then came here and foung his solution. Mine doesn't ever look pythonic.