mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Fix indentation contains tabs (flake8 E101,W191) (#1573)
This commit is contained in:

committed by
John Law

parent
dbaedd4ed7
commit
b838f1042c
@ -1,9 +1,9 @@
|
||||
"""
|
||||
The sum-of-subsetsproblem states that a set of non-negative integers, and a value M,
|
||||
determine all possible subsets of the given set whose summation sum equal to given M.
|
||||
The sum-of-subsetsproblem states that a set of non-negative integers, and a value M,
|
||||
determine all possible subsets of the given set whose summation sum equal to given M.
|
||||
|
||||
Summation of the chosen numbers must be equal to given number M and one number can
|
||||
be used only once.
|
||||
Summation of the chosen numbers must be equal to given number M and one number can
|
||||
be used only once.
|
||||
"""
|
||||
|
||||
|
||||
@ -18,12 +18,12 @@ def generate_sum_of_subsets_soln(nums, max_sum):
|
||||
|
||||
def create_state_space_tree(nums, max_sum, num_index, path, result, remaining_nums_sum):
|
||||
"""
|
||||
Creates a state space tree to iterate through each branch using DFS.
|
||||
It terminates the branching of a node when any of the two conditions
|
||||
given below satisfy.
|
||||
This algorithm follows depth-fist-search and backtracks when the node is not branchable.
|
||||
Creates a state space tree to iterate through each branch using DFS.
|
||||
It terminates the branching of a node when any of the two conditions
|
||||
given below satisfy.
|
||||
This algorithm follows depth-fist-search and backtracks when the node is not branchable.
|
||||
|
||||
"""
|
||||
"""
|
||||
if sum(path) > max_sum or (remaining_nums_sum + sum(path)) < max_sum:
|
||||
return
|
||||
if sum(path) == max_sum:
|
||||
@ -41,7 +41,7 @@ def create_state_space_tree(nums, max_sum, num_index, path, result, remaining_nu
|
||||
|
||||
|
||||
"""
|
||||
remove the comment to take an input from the user
|
||||
remove the comment to take an input from the user
|
||||
|
||||
print("Enter the elements")
|
||||
nums = list(map(int, input().split()))
|
||||
|
Reference in New Issue
Block a user