This problem asks you to find the maximum path sum from the root to a leaf in a binary tree. An example input and output are given.
Print the power set of a set of distinct integers. The power set of a set is the set of all its subsets.
This problem is about printing all numbers from 1 to n in ascending order. The function takes in a number n and prints out all numbers from 1 to n.
This problem deals with printing the power set of a given set of distinct integers. The power set is the set of all subsets of a given set, including the empty set and the original set itself. In this case, the input is {1, 2, 3} and the output should be {{}, {1}, {2}, {3}, {1, 2}, {1 , 3}, {2, 3}, {1, 2, 3}}.
This problem asks the programmer to find the sum of all elements in an array. An example input is given, along with the expected output.
Given a string, the goal is to find the length of the longest substring without repeating characters. For example, given the string "abcabcbb", the longest substring would be " abc", with a length of 3.
Write a function that returns the longest palindromic substring of a given string. For example, given the input "babad", the function would return "bab".
The problem is to find the sum of all elements in an array using recursion.