Skip to content

Commit

Permalink
Merge pull request #50 from eross156/eross156-patch-1
Browse files Browse the repository at this point in the history
Fenwick Tree Correction
  • Loading branch information
howsiwei authored Aug 8, 2020
2 parents a49dd07 + 8ab2ec0 commit 0ba81b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ch2/ourown/fenwicktree_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def lsone(self, s):

def query(self, i, j):
if i > 1:
return self.query(1, j) - self.query(1, j - 1)
return self.query(1, j) - self.query(1, i - 1)

s = 0
while j > 0:
Expand Down

0 comments on commit 0ba81b4

Please sign in to comment.