79263872

Date: 2024-12-09 05:05:14
Score: 1
Natty:
Report link

The last line of the file was empty, so [a, b] was destructuring to ["",undefined]. I just added a filter.

const coordinateListString = await Deno.readTextFile("input.txt");

let aSetBCoordinateList = coordinateListString
  .split("\n")
  .filter(line => line !== "")
  .map(str => str.split("   "))
  .map(([a,b]) => [new Set([...a].map(Number)), b.split("")]);
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user8585207