Question: You are given a set of integer numbers A = {a1, a2, ..., an}, where 1 ai m for all 1 i n and for
You are given a set of integer numbers A = {a1, a2, ..., an}, where 1 ai m for all 1 i n and for a given positive integer m. Give an algorithm which determines whether you can represent a given positive integer k nm as a sum of some numbers from A, if each number from A can be used at most once. Your algorithm must have O(nk) time complexity.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
