Your task is to create a function called bracket_validator that checks whether a string contains valid and correctly paired brackets.
| Input | Output | Reason |
|---|---|---|
( ) |
true | Properly matched |
(() |
false | One bracket is not closed |
( 2+2 (-3*6)*7)) |
false | Extra closing bracket with no opening match |
Implement bracket_validator(input_string) so that it accurately identifies whether the bracket structure in the given string is valid.
Good luck! πͺ