checkValidString = function(s) {
   let [ left, right ] = [ 0, 0 ];

   for (const char of s) {/* Time O(N) */
       left += isOpened(char) ? 1 : -1;
       right += !isClosed(char) ? 1 : -1;
       
       const isNegative = right < 0;
       if (isNegative) break;

       left = Math.max(left, 0);
   }
    
   return left === 0;
}
Time O(N) | Space O(1)
@param {string} s
@return {boolean}