Math, asked by Kiran2566, 10 months ago

Given an array of positive numbers, find smallest number that cannot be formed with sum of numbers from an array

Answers

Answered by dia190
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