Skip to content

Commit

Permalink
Update count_subsequences.py
Browse files Browse the repository at this point in the history
  • Loading branch information
everysoftware authored Feb 17, 2025
1 parent 214ead4 commit 25565e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/g_prefix_sums/count_subsequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def count_subsequences_ps(k: int, a: list[int]) -> int:
for i in range(4, n):
# Добавляем элемент в сумму
s += a[i]
# Если сумма подходит сама по себе, увеличиваем счетчик на 1
# Если сумма подходит, увеличиваем счетчик на 1
if s % k == 0:
count += 1
# Считаем число подходящих подпоследовательностей.
Expand Down

0 comments on commit 25565e6

Please sign in to comment.