Last active
May 11, 2021 19:31
-
-
Save froggomad/c32d9b43bc054115b3250ed7e340b38e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ListNode { | |
func forEach() { | |
var current: ListNode? = self | |
while current != nil { | |
print(current!.val) | |
current = current!.next | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment