def METHOD_NAME(array_in, segments):
    """ Remove duplicates from an array and create a map to reassign values referring to it"""
    array_out = []
    reassign = {}
    out_segments = []
    prev_start = 0
    for end in segments:
        sub_array_in = array_in[prev_start:end]
        offset = len(array_out)
        sub_array_out = []
        for index, value in enumerate(sub_array_in):
            # obj files start their indices for everything at 1
            if value in sub_array_out:
                reassign[prev_start + index + 1] = offset + sub_array_out.index(value) + 1
            else:
                sub_array_out.append(value)
                reassign[prev_start + index + 1] = offset + len(sub_array_out)
        array_out += sub_array_out
        out_segments.append(len(array_out))
        prev_start = end
    return array_out, reassign, out_segments