Driver Code
let X = " " . split ( " " ) ; let n = 6 ; if ( isBalanced ( X , n ) ) document . write ( " " ) ; else document . write ( " " ) ; let Y = " " . split ( " " ) ; n = 7 ; if ( isBalanced ( Y , n ) ) document . write ( " " ) ; else document . write ( " " ) ;