loop to find all left and right part of the string
for ( int i = 0 ; i < l - 1 ; i ++ ) { string left = s . substr ( 0 , i + 1 ) ; string right = s . substr ( i + 1 ) ; int x = stoi ( left ) ; int y = stoi ( right ) ; if ( ! isPrime ( x + y ) ) return false ; } return true ; }