This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 寻找和等于k的子数组问题《计算之魂》 | |
data = [5, 2, 7, 0, 0, 8, 7, 1, 1, 2, 5, 6] | |
k = 9 | |
# 部分和字典 | |
part_sum_dict = {} | |
result_number = 0 | |
current_sum = 0 | |
for i, num in enumerate(data): |