This will reverse output. In this case, where range 0..1 will output 0, range 1..0 will output 1:
src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0
dest [0, 1]: 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0
dest [1, 0]: 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0
Not necessary to swap destination min and max if the source min is negative, the instructor probably had some reason to invert the range (better logic, later convenience, etc.). Try visualize the value.