good code

Note: use reference of the num, do not copy it to a new vector.