This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# track number of iterations | |
BIG_O = 0 | |
def find_k_numbers_that_add_upto_sum(arr, k, sum): | |
""" | |
A generic solution to the problem of Finding k numbers in an array | |
that add up to a given sum. | |
The solution is based on the assumption that the numbers in the array | |
are distinct. | |
- Works for both positive and negative numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
class Manager: | |
""" | |
Manages the call flow, serves as the midware manager | |
""" | |
def __init__(self): | |
self.__list = L_List() |