commit 3 : returning 0 if open brackets come frist