variable to represent the number after converting it to base 5. Since the digits are be in reverse order , we traverse vector from back
int result = 0 ; for ( int i = v . size ( ) - 1 ; i >= 0 ; i -- ) { result = result * 10 ; result = result + v [ i ] ; }