Skip to content

Commit c02094f

Browse files
Update algorithms/greedy/minimum_number_of_pushes/__init__.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 6e7e00f commit c02094f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

algorithms/greedy/minimum_number_of_pushes/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44

55
def minimum_pushes_greedy_with_sorting(word: str) -> int:
6-
# frequency vector of size 26 that storees the count of each letter in the word
6+
# frequency vector of size 26 that stores the count of each letter in the word
77
# Space complexity here is O(1) because we have a constant space for the given list, i.e. 26
88
frequency = [0] * 26
99

10-
# Iterate throuch each character and increment the count in the frequency at the index corresponding to char - "a"
10+
# Iterate through each character and increment the count in the frequency at the index corresponding to char - "a"
1111
# since we know from the given constraints that we will have lowercase English letters, this will work fine
1212
# This is an O(n) operation, as each character in the word is iterated through
1313
for char in word:

0 commit comments

Comments
 (0)