title: trying to check valid parentheses/bracket pairing
body: <p>given a string of solely parentheses, brackets, etc., I'm trying to return true if the pairings are correct. (there are some similar questions but they involve more complicated stuff like arrays, other characters in the string, etc.) </p>
  
  <p>here is my code, it returns false when I input "()"</p>
  
  <pre><code>class Solution {
      public boolean isValid(String s) {
          if (s.length() &lt; 2) {
              return false;
          }
  
          for (int i = 0; i &lt; s.length() - 1; i++) {
              char char1 = s.charAt(i);
              char char2 = s.charAt(i + 1);
              if ((int) char1 != (int) char2) {
                  return false;
              }
          }
          return true;
      }
  }
  </code></pre>
  
  <p>Any help or advice would be appreciated!</p>