DSA Problems and their solutions.
View the Project on GitHubvaibhavvikas/dsa-problems
copy the next data to current node and mark next of current of next.next
TC: O(1) SC: O(1)
def del_node(node): if not node.next: node = None return node.data = node.next.data node.next = node.next.next