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
Node = type("Node",(),{'__init__': lambda self, data, _next=None: setattr(self, "data", data) or setattr(self, "next", _next),'__repr__': lambda self: f"Node<{self.data.__repr__()}>",'__gt__': lambda self, other: self.data > other.data if other.__class__ == Node else self.data > other});LinkedList = type("LinkedList",(),{'__init__': lambda self, data=None:setattr(self, "head", None) or setattr(self, "last", None)or setattr(self, "len", 0) or data is not None and self.extend(data) or None,'_ci': lambda self, index: index if index >= 0 else self.len + index,'append': lambda self, obj:(last := Node(obj))and (self.head is not None or not setattr(self, "head", last))and (self.last is None or not setattr(self.last, "next", last))and not setattr(self, "last", last) and setattr(self, "len", self.len + 1),'index': lambda self, obj, start=0, stop=None:(stop := self.len if stop is None else stop) * 0 or(start := self._ci(start), stop := self._ci(stop)) and( __loop := lambda index, item:None if item is None or index >= s |