Skip to content

Commit 7051fee

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cd20b4d commit 7051fee

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

data_structures/linked_list/merge_k_sorted_list.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" This algorithm merges k sorted linked lists into a single sorted linked list.
1+
"""This algorithm merges k sorted linked lists into a single sorted linked list.
22
33
Each input linked list is assumed to be sorted in non-decreasing order. The algorithm uses a min-heap (priority queue) to efficiently determine the next smallest node among all the heads of the lists.
44
@@ -16,6 +16,7 @@
1616
Solve on:
1717
https://leetcode.com/problems/merge-k-sorted-lists/
1818
"""
19+
1920
from __future__ import annotations
2021
from collections.abc import Iterable, Iterator
2122
from dataclasses import dataclass
@@ -62,7 +63,7 @@ def merge_two_lists(
6263
def merge_k_sorted_lists(lists: list[SortedLinkedList]) -> SortedLinkedList:
6364
"""
6465
Merge k sorted linked lists into one sorted linked list.
65-
66+
6667
>>> SSL = SortedLinkedList
6768
>>> lists = [SSL([1, 4, 7]), SSL([2, 5, 8]), SSL([3, 6, 9])]
6869
>>> merged = merge_k_sorted_lists(lists)
@@ -109,5 +110,5 @@ def merge_k_sorted_lists(lists: list[SortedLinkedList]) -> SortedLinkedList:
109110
print("Merged K Sorted Lists:")
110111
print(merged_k)
111112

112-
'''
113-
'''
113+
"""
114+
"""

0 commit comments

Comments
 (0)