Skip to content

Commit

Permalink
tidyup - fixed typeof checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Barbaric committed Jul 31, 2024
1 parent 0f5b1c9 commit ec051fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algos/array/two_pointers/squares_of_sorted_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def return_squares(l1: list[int]) -> list[int]:
negative_num = "None" if left < 0 else l1[left]
positive_num = "None" if right >= len(l1) else l1[right]

if negative_num is str:
if isinstance(negative_num, str):
ans[i] = positive_num ** 2
right += 1
elif positive_num is str:
elif isinstance(positive_num, str):
ans[i] = negative_num ** 2
left -= 1
else:
Expand Down

0 comments on commit ec051fa

Please sign in to comment.