- check if the length of the string is greater than 1. if its not we return false.
- Make the string an array and loop through it.
- Create a stack and store opening brackets inside.
- Check if the next closing bracket is equal to the last element in stack. if it is i return true else i return false.
- Time complexity: O(N)