编辑代码

function isFieldInPairedQuotes(arr, strings) {
    const regex = /(['"])(.*?)\1/;
    const strSet = new Set(strings);
    for (let i = 0; i < arr.length; i++) {
        const match = arr[i].match(regex);
        if (match && strSet.has(match[2])) {
            strSet.delete(match[2]);
            if (strSet.size === 0) {
                return true;
            }
        }
    }
    return false;
}

let arr =['"', 'a', '"', '"', 'b', '"', '"', 'c', '"'];
console.log(arr.join(''))
const result1 = isFieldInPairedQuotes(arr, ["dds"])
console.log(result1)