Computing the distance to the functions with range in a given set in Lebesgue spaces of vector-valued functions