Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions anagrams/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def anagrams(self, strs):
res = []
for i, s in enumerate(strs):
key = self.make_key(s)
# First occurence of an anagram
# First occurrence of an anagram
if key not in d:
d[key] = [s]
else:
Expand All @@ -26,7 +26,7 @@ def make_key(self, s):
else:
d[c] = 1
# Iterate form 'a' to 'z'
# This make sure the character occurences is ordered
# This make sure the character occurrences is ordered
# and thus unique
for i in range(ord('a'), ord('z') + 1):
c = chr(i)
Expand Down
2 changes: 1 addition & 1 deletion jump_game_ii/solution3.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def jump(self, nums):
Time Limit Exceeded
"""
n = len(nums)
# t[i] means mininum number of jumps to nums[i]
# t[i] means minimum number of jumps to nums[i]
t = [-1 for i in range(n)]
t[0] = 0
if n == 1:
Expand Down
4 changes: 2 additions & 2 deletions search_for_a_range/solution2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def searchRange(self, nums, target):
right = n - 1
left_res = -1
right_res = -1
# Search for left bound (first occurence of target)
# Search for left bound (first occurrence of target)
while left + 1 < right:
mid = left + (right - left) / 2
if target > nums[mid]:
Expand All @@ -37,7 +37,7 @@ def searchRange(self, nums, target):
else:
return [-1, -1]

# Search for right bound (last occurence of target)
# Search for right bound (last occurrence of target)
left = 0
right = n - 1
while left + 1 < right:
Expand Down