def get_solution(x, values):
    """
    Get the solution to the knapsack problem
    from the bitstring that represents
    to the ground state of the Hamiltonian

    Args:
        x (numpy.ndarray): the ground state of the Hamiltonian.
        values (numpy.ndarray): the list of values

    Returns:
        numpy.ndarray: a bit string that has a '1' at the indexes
         corresponding to values that have been taken in the knapsack.
         i.e. if the solution has a '1' at index i then
         the value values[i] has been taken in the knapsack
    """
    return x[:len(values)]
