mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-31 02:46:43 +00:00
Formatting Fixes
This commit is contained in:
parent
00b17c4c7c
commit
3418c8031f
@ -14,15 +14,15 @@ def min_window(search_str: str, target_letters: str) -> str:
|
|||||||
in the window, and shifting the start of the window right until the
|
in the window, and shifting the start of the window right until the
|
||||||
window no longer contains every target character.
|
window no longer contains every target character.
|
||||||
|
|
||||||
Time complexity: O(target_count + search_len) ->
|
Time complexity: O(target_count + search_len) ->
|
||||||
The algorithm checks a dictionary at most twice for each character
|
The algorithm checks a dictionary at most twice for each character
|
||||||
in search_str.
|
in search_str.
|
||||||
|
|
||||||
Space complexity: O(search_len) ->
|
Space complexity: O(search_len) ->
|
||||||
The primary contributer to additional space is the building of a
|
The primary contributer to additional space is the building of a
|
||||||
dictionary using the search string.
|
dictionary using the search string.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
target_count = len(target_letters)
|
target_count = len(target_letters)
|
||||||
search_len = len(search_str)
|
search_len = len(search_str)
|
||||||
|
|
||||||
@ -84,4 +84,4 @@ def min_window(search_str: str, target_letters: str) -> str:
|
|||||||
if (exists):
|
if (exists):
|
||||||
return search_str[min_window[0]:min_window[1]]
|
return search_str[min_window[0]:min_window[1]]
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user