Smallest number that cannot be formed from sum of numbers from array
There’s a beautiful algorithm for solving this problem in time O(n + Sort), where Sort is the amount of time required to sort the input array. The idea behind the algorithm is to sort the array and then ask the following question: what is the smallest positive integer you cannot make using the first k … Read more