Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 13, 2023
1 parent e7dd371 commit 0a181c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bit_manipulation/missing_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ def find_missing_number(nums: list[int]) -> int:
missing_number = n

for i in range(n):
if(nums[i]<0):
if nums[i] < 0:
raise ValueError("negative values not supported")
missing_number ^= i ^ nums[i]

return missing_number


if __name__ == "__main__":
import doctest
doctest.testmod()

doctest.testmod()

0 comments on commit 0a181c6

Please sign in to comment.