Modify the bracketsBalance function so that the caller can supply the brackets to match as arguments to this function. The second argument should be a list of beginning brackets, and the third argument should be a list of ending brackets. The pairs of brackets at each position in the two lists should match, that is, position 0 in the two lists might have [ and ], respectively. You should be able to modify the code for the function so that it does not reference any literal bracket symbols, but just uses the list arguments. (Hint: The method index returns the position of an item in a list.)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here