Subset Sum Problem

Subset Sum Problem

Detect if a subset from a given set of N non-negative integers sums up to a given value S.
Example:
Set: {1, 3, 9, 2}, S = 5
Output: true

Checkout this link for the video on Dynamic Programming solution:
https://www.ideserve.co.in/learn/subset-sum-dynamic-programming

Subscribe for more updates:
https://www.youtube.com/c/IDeserve

要查看或添加评论,请登录

Saurabh Kumar的更多文章

  • Number of clusters of 1s OR Number of Islands

    Number of clusters of 1s OR Number of Islands

    Given a 2D matrix of 0s and 1s, find total number of clusters formed by elements with value 1. For example, in the…

    1 条评论
  • Shortest Palindrome

    Shortest Palindrome

    Given a string s, form a shortest palindrome by appending characters at the start of the string. Example: abab => babab…

    1 条评论
  • Find all permutations of a String

    Find all permutations of a String

    Given a string, find all the permutations of the string. For example: Input String: abc Output: {bca, acb, abc, cba…

  • Print Matrix Diagonally

    Print Matrix Diagonally

    Given a matrix of mxn dimensions, print the elements of the matrix in diagonal order. Check out the video for solution:

  • Find maximum element from each sub-array of size k

    Find maximum element from each sub-array of size k

    Given input as an integer array and an integer 'k', find and print element with maximum value from each sub-array of…

    1 条评论
  • Check if a number can be expressed as x raised to power y

    Check if a number can be expressed as x raised to power y

    Given a positive integer, find if it can be expressed by integers x and y as x^y where y > 1 and x > 0. Example:…

  • Breadth first search in a graph

    Breadth first search in a graph

    Given a graph, check if path exists between source node and destination node using breadth first search. In the breadth…

  • Generate all subsets of a given set

    Generate all subsets of a given set

    Given a set, generate all possible subsets of it. For example if the input set is {1,2,3} then the program should…

  • Merge Sort

    Merge Sort

    Given an integer array, sort the array using Merge Sort algorithm. Example: Array: 12, 35, 87, 26, 9, 28, 7 Output: 7…

  • Sorting Algorithm - Heap Sort

    Sorting Algorithm - Heap Sort

    Heap sort is an in-place comparison sort. Heap sort is not a stable sort i.

社区洞察

其他会员也浏览了