Given an array of positive numbers, find smallest number that cannot be formed with sum of numbers from an array
Answers
Answered by
0
Step-by-step explanation:
A naive method to solve this problem is to search all positive integers, starting from 1 in the given array. We may have to search at most n+1 numbers in the given array. So this solution takes O(n^2) in worst case.
Similar questions