/BestSum

Choose Best Summation

Primary LanguagePython

Choose Best Summation


Find the best fit to lookup value                       (ref_val)
By calculating the sum of n number                      (size) 
From combination of list of integer provided            (ls)

Required:
    :param:  -> int     - (ref_val)
    :param:  -> int     - (size)
    :param:  -> list    - (ls)
    :return: -> int     - the nearest at most of int ref_val

Example:
    choose_best_sum(39, 3, [14, 14, 3, 7, 14, 21, 5, 12, 23, 22, 16, 11, 23, 12, 16, 18, 1])
        => (14, 14, 11), 39

DISCLAIMER!

no guarantee of completeness, accuracy, timeliness or 
of the results obtained from the use of this information

For more information:

Visit [Wikipedia](https://en.wikipedia.org/wiki/Combination)