Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/backtracking/src/subset_sum/subset_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def subsetsum(cs, k, r, x, w, d):
# Main array w
w = [2, 3, 4, 5, 0]
x = [0 for i in range(len(w))]
print("Enter the no u want to get the subsets sum for")
print("Enter the number you want to get the subsets sum for: ")
num = int(input())
if num <= sum(w):
print("The subsets are:-\n")

subsetsum(0, 0, sum(w), x, w, num)
else:
print(
"Not possible The no is greater than the sum of all the elements in the array"
"Not possible! The number is greater than the sum of all the elements in the array."
)