This file contains 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
class TreeNode: | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None | |
# Example usage: | |
n1 = TreeNode(5) |
This file contains 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
example = [[[10, 20], [10, 10]], 40] | |
def solve(list, index, sum, item_desired_value): | |
print(list, index, sum, item_desired_value) | |
if index >= len(list): | |
return sum == 0 | |
item = list[index] |