If it is negative , calculate the + ve number first ignoring the sign and invert the sign at the end
else for ( int i = 1 ; i < s . length ( ) ; i ++ ) { num = num * 10 + ( int ( s [ i ] ) - 48 ) ; num = num * -1 ; } return num ; }