This was my professor's interpretation but he didn’t provide an example:
there could be training points at the same distance from x such that more than k points are closest to x. In this case, we proceed by ranking the training points based on their distance from x and then taking the k′ closest points where k′ is the smallest integer bigger or equal to k such that the (k′+ 1)-th point in the ranking has distance from x strictly larger than the k'-th point. If no such k′ exists, then we take all the points