Java code to calculate the minimum cost to make the given parentheses balanced
import java . io . * ; class GFG { static int costToBalance ( String s ) { if ( s . length ( ) == 0 ) System . out . println ( 0 ) ;