fix(posts): fetch daily from files

This commit is contained in:
Barrett Ruth 2024-11-29 22:13:16 -06:00
parent 3d2ee97afe
commit 2bcc3f4675
9 changed files with 691 additions and 0 deletions

View file

@ -0,0 +1,11 @@
def countFairPairs(self, nums, lower, upper):
nums.sort()
ans = 0
for i, num in enumerate(nums):
k = bisect_left(nums, lower - num, 0, i)
j = bisect_right(nums, upper - num, 0, i)
ans += k - j
return ans