Update mindistance.cpp

Change the name of Swap() to Replace()