code: func getPodsToPreemptByDistance(pods []*v1.Pod, requirements admissionRequirementList) ([]*v1.Pod, error) {
  	podsToEvict := []*v1.Pod{}
  	// evict pods by shortest distance from remaining requirements, updating requirements every round.
  	for len(requirements) > 0 {
  		if len(pods) == 0 {
  			return nil, fmt.Errorf("no set of running pods found to reclaim resources: %v", requirements.toString())
  		}
  		// all distances must be less than len(requirements), because the max distance for a single requirement is 1
  		bestDistance := float64(len(requirements) + 1)
  		bestPodIndex := 0
  		// Find the pod with the smallest distance from requirements
  		// Or, in the case of two equidistant pods, find the pod with "smaller" resource requests.
  		for i, pod := range pods {
  			dist := requirements.distance(pod)
  			if dist < bestDistance || (bestDistance == dist && smallerResourceRequest(pod, pods[bestPodIndex])) {
  				bestDistance = dist
  				bestPodIndex = i
  			}
  		}
  		// subtract the pod from requirements, and transfer the pod from input-pods to pods-to-evicted
  		requirements = requirements.subtract(pods[bestPodIndex])
  		podsToEvict = append(podsToEvict, pods[bestPodIndex])
  		pods[bestPodIndex] = pods[len(pods)-1]
  		pods = pods[:len(pods)-1]
  	}
  	return podsToEvict, nil
  }
docs: // getPodsToPreemptByDistance finds the pods that have pod requests >= admission requirements.
  // Chooses pods that minimize "distance" to the requirements.
  // If more than one pod exists that fulfills the remaining requirements,
  // it chooses the pod that has the "smaller resource request"
  // This method, by repeatedly choosing the pod that fulfills as much of the requirements as possible,
  // attempts to minimize the number of pods returned.