Test case details

Preparation Code

const r = () => Math.round(Math.random() * 1000) - 500; const points = []; for (let i = 0; i < 10000; i++) { points.push([r(), r()]); } const cantor = (x, y) => (((x + y) * (x + y + 1)) / 2) + y;

Test cases

Test #1

for (const p of points) { const result = cantor(p[0], p[1]); }

Test #2

for (const p of points) { const result = p.toString(); }

Test #3

for (const p of points) { const result = `${p[0]},${p[1]}`; }