Skip to content

Instantly share code, notes, and snippets.

# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
import itertools as it
class IterableListNode(ListNode):
@classmethod
def from_ListNode(cls, list_node):