Skip to content

Commit 3eadae1

Browse files
authored
Simplify time and space complexity comments
Removed redundant complexity explanations in docstring.
1 parent 556316e commit 3eadae1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sprint-1/Python/find_common_items/find_common_items.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def find_common_items(
99
"""
1010
Find common items between two arrays.
1111
12-
Time Complexity: The time complexity is O(n + m) because we build a set from the second sequence in O(m) time and iterate through the first sequence in O(n) time.
13-
Space Complexity: The space complexity is O(n + m) because we store up to all elements of the second sequence in a set and up to the common elements in additional storage.
14-
Optimal time complexity: The time complexity is O(n + m) and the space complexity is O(n + m).
12+
Time Complexity: The time complexity is O(n + m)
13+
Space Complexity: The space complexity is O(n + m)
14+
Optimal time complexity: The time complexity is O(n + m)
1515
"""
1616
second_set = set(second_sequence)
1717
seen = set()

0 commit comments

Comments
 (0)