Condition if zero does not exist or the sum is not divisible by 3
if ( zero_exist == false sum % 3 != 0 ) { cout << " - 1" << " STRNEWLINE " ; return ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int val = s [ i ] - '0' ;