Test case details

Preparation Code

const randomString = () => Math.random().toString(36).slice(2, 7) const getAllBuckets = () => { return new Array(2e5).fill(1).map((b) => randomString()) }

Test cases

Test #1

const all = getAllBuckets() const excludedLookup = new Set(all) const included = [] for (const b of all) { if (!excludedLookup.has(b)) { included.push(b) } }

Test #2

const all = getAllBuckets() const allSet = new Set(all) for (const b of all) { allSet.delete(b) } const done = Array.from(allSet)

Test #3

const all = getAllBuckets() const excludedLookup = new Set(all.slice(0, 10)) const included = [] for (const b of all) { if (!excludedLookup.has(b)) { included.push(b) } }

Test #4

const all = getAllBuckets() const allSet = new Set(all) for (const b of all.slice(10)) { allSet.delete(b) } const done = Array.from(allSet)