def call(self, a: List[int], b: List[int]) -> int: node = self.getIntersectionNode(ListNode.fromList(a), ListNode.fromList(b)) return node.val
def call(self, data: List[int], k: int) -> List[int]: head = self.removeNthFromEnd(ListNode.fromList(data), k) return head and head.toList() or []
def call(self, l: List[int]) -> List[int]: node = self.reverseList(ListNode.fromList(l)) return node and node.toList() or []
def call(self, data: List[int]) -> bool: return self.isPalindrome(ListNode.fromList(data))
def call(self, l1: List[int], l2: List[int]) -> List[int]: node = self.addTwoNumbers(ListNode.fromList(l1), ListNode.fromList(l2)) if not node: return [] return node.toList()
def call(self, data: List[int]) -> List[int]: head = ListNode.fromList(data) self.reorderList(head) return head.toList()
def call(self, data: List[int], val: int, cycle: int = -1) -> Tuple[int, int]: node = self.insert(ListNode.fromList(data, cycle), val) return node.val
def call(self, data: List[int], cycle: int) -> int: node = self.detectCycle(ListNode.fromList(data, cycle)) if not node: return -1 return node.val