Update reverse.cpp