check if there 's any k sum path that   terminates at this node   Traverse the entire path as   there can be negative elements too
f = 0 NEW_LINE for j in range ( len ( path ) - 1 , - 1 , - 1 ) : NEW_LINE INDENT f += path [ j ] NEW_LINE DEDENT