Skip to content

Commit 65cf7b2

Browse files
committed
explaine complexity
1 parent 9d9c1be commit 65cf7b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sprint-2/improve_with_precomputing/count_letters/count_letters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def count_letters(string: str) -> int:
1818
count += 1
1919
return count
2020

21+
# The Space complexity for new and old script is O(n), but Time complexity the old one is O(n)^2 which is insufficient compare
22+
# to new code Time complexity O(n).
2123

22-
def is_upper_case(letter: str) -> bool:
24+
25+
def is_upper_case(letter: str) -> bool:
2326
return letter == letter.upper()

0 commit comments

Comments
 (0)