use std::deque and reverse digit
accepted in C++11