How is the standard and definitive algorithm of matching brace pairs, as a point at a brace or within brace pair must find correctly the either or both open/close brace?
Normally you'd just push each '{' symbol onto a stack, and pop off the symbol once you find a '}'.
If, at the end of the file, you have anything left in the stack, or if you try to pop an empty stack, then something is mismatched.
Don't post in other people's threads to tell someone something off-topic. Don't ask someone specifically to check out your question in a public forum. Just because someone posted in your thread doesn't entitle you to their follow-up response.