Category: Knapsack Problems
You are given two lists of integers weights and values which have the same length and an integer capacity. weights and values represent the weight and value of the …
You are given two lists of integers weights and values which have the same length and an integer capacity. weights and values represent the weight and value of the …
Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is …
You have some coins. The i-th coin has a probability prob of facing heads when tossed. Return the probability that the number of coins facing heads equals target if …
You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may …