Friday, September 5, 2014

NumbersChallenge



Problem

Idea : You are given a number sequence and you have to find out the smallest number that can not be formed by the adding some combination of given integers .

To do so , we can evaluate all combination produced value . If the amount of given integer is N . Then 2^N combination is possible . We can use bitmask to make the values that produce the given integer sequence .

 We calculate those value and give true result for those values in a boolean array . Then iterating from first , we can easily find out the required value . 

My Solution


No comments:

Post a Comment