export function validateString(input: string, index: number, stack: number = 0): boolean {
// TODO: your code
if(index === 0 && (input[index] === ')' | input[index] === '}' | input[index] === ']')) {
return false;
}
if(input[index] === '(' | input[index] === '{' | input[index] === '[') {
stack++;
}
validateString(input, index + 1, )
}
// See https://www.chaijs.com for how to use Chai.
import { assert } from "chai";
import { validateString } from "./solution";
describe('validateString', function() {
it('test', function() {
assert.strictEqual(validateString('{([])}', 0), true);
assert.strictEqual(validateString('(A[B{C}D]E)', 0), true);
assert.strictEqual(validateString('a(b[d{a+b]/2]/4)/1', 0), false);
assert.strictEqual(validateString('[}{})()', 0), false);
});
});