https://medium.com/@rabinarayandev/optimized-java-solution-for-the-leetcode-valid-parentheses-problem-a-step-by-step-guide-2d258b6a2c88