This talks about the second law of thermodynamics. The second law states that in all energy interactions, if no energy arrives or leaves the system, the potential energy of the state will always be a lesser amount of than that of the early state. This is also usually referred to as entropy. In the problem, the energy did not impulsively go from cold to hot therefore the second law is not violated.