mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-22 05:37:36 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
82270b7c63
commit
ff5a9b81c4
@ -92,13 +92,15 @@ class PersistentSegmentTree:
|
|||||||
if left <= start and right >= end:
|
if left <= start and right >= end:
|
||||||
return node.value
|
return node.value
|
||||||
mid = (start + end) // 2
|
mid = (start + end) // 2
|
||||||
return (self._query(node.left, start, mid, left, right) +
|
return self._query(node.left, start, mid, left, right) + self._query(
|
||||||
self._query(node.right, mid + 1, end, left, right))
|
node.right, mid + 1, end, left, right
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Running the doctests
|
# Running the doctests
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|
||||||
print("Running doctests...")
|
print("Running doctests...")
|
||||||
result = doctest.testmod()
|
result = doctest.testmod()
|
||||||
print(f"Ran {result.attempted} tests, {result.failed} failed.")
|
print(f"Ran {result.attempted} tests, {result.failed} failed.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user