Print the balanced bracket expression using given brackets | Function to print balanced bracket expression if it is possible ; If the condition is met ; Print brackets of type - 1 ; Print brackets of type - 3 ; Print brackets of type - 4 ; Print brackets of type - 2 ; If the condition is not met ; Driver code
< ? php function printBalancedExpression ( $ a , $ b , $ c , $ d ) { if ( ( $ a == $ d && $ a ) || ( $ a == 0 && $ c == 0 && $ d == 0 ) ) { for ( $ i = 1 ; $ i <= $ a ; $ i ++ ) echo " ( ( " ; for ( $ i = 1 ; $ i <= $ c ; $ i ++ ) echo " ) ( " ; for ( $ i = 1 ; $ i <= $ d ; $ i ++ ) echo " ) ) " ; for ( $ i = 1 ; $ i <= $ b ; $ i ++ ) echo " ( ) " ; } else echo - 1 ; } $ a = 3 ; $ b = 1 ; $ c = 4 ; $ d = 3 ; printBalancedExpression ( $ a , $ b , $ c , $ d ) ; ? >