#  Hint:  You may not need all of these.  Remove the unused functions.
from hashtables import (HashTable,
                        hash_table_insert,
                        hash_table_remove,
                        hash_table_retrieve,
                        hash_table_resize)


def get_indices_of_item_weights(weights, length, limit):
    # weights = weights_1, weights_2, etc
    # length = lenght of weights_1, weights2, etc
    # limit = Amount needed when the 2 weights are added together
    ht = HashTable(16)

    """
    YOUR CODE HERE
    """
    result = []

# Must add 2 numbers, so only 1 number would automatically be false
    if length == 1:
        result = None

# insert values
    for i in range(length):
        hash_table_insert(ht, weights[i], i)

# retrieve values
    for i in range(length):
        package1 = weights[i]
        package2 = limit - package1
        check = hash_table_retrieve(ht, package2)

        if check is not None:
            if check > i:
                result = (check, i)

            elif check < i:
                result = (i, check)


    return result

def print_answer(answer):
    if answer is not None:
        print(str(answer[0] + " " + answer[1]))
    else:
        print("None")
