Increment the count if it an opening bracket
if ( s [ i ] == ' ( ' ) { F [ i , c_x , c_y ] = noOfAssignments ( s , n , i + 1 , c_x + 1 , c_y ) + noOfAssignments ( s , n , i + 1 , c_x , c_y + 1 ) ; return F [ i , c_x , c_y ] ; } F [ i , c_x , c_y ] = 0 ;