Given a set of distinct integers, this problem returns all possible subsets that can be formed from those integers. For example, if the input is [1,2,3], the output would be [[3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], []].
Given an array of integers, write a function that returns the sum of all the odd numbers in the array.
This problem deals with finding a subset of distinct integers that sum to a given number. An example input and output are given.
Given a binary tree, this function determines whether the tree is balanced. A balanced binary tree is one in which the left and right subtrees of each node have heights that differ by no more than 1. This example input results in an output of True.
This program prints the power set of a given set of distinct integers. The power set of a set is the set of all its subsets.
Given a set of distinct integers, this program prints out the power set of the set. The power set of a set is the set of all its subsets.
Given a binary tree, this algorithm finds the maximum path sum. A path is defined as a sequence of nodes from some starting node to any node in the tree along the parent-child connections . The path must contain at least one node and does not need to go through the root.
This problem asks you to find the maximum path sum in a binary tree. A path is defined as any sequence of nodes from some starting node to any node in the tree along the parent- child connections. The path must contain at least one node and does not need to go through the root.