First ignore all the whitespaces. Remember the sign by using a sign variable and simply "form" a number by appending the digits encountered. If the number exceeds Integer.MAX_VALUE we return ...
Cuireadh roinnt torthaí i bhfolach toisc go bhféadfadh siad a bheith dorochtana duit
Taispeáin torthaí dorochtana