As you have probably noticed, most code editors check if you used the right number of brackets in your code.
Write a simple brackets checker that, given a string, prints OK if all the brackets are used correctly, and ERROR, otherwise.
Don't forget to check that the brackets are in the correct order (an opening and then a closing one).
A little hint: each time you encounter an opening bracket (, put it on the stack. Do the opposite when you encounter a closing bracket.