filter bad strings from file

This commit is contained in:
Elizabeth Hunt 2023-12-02 11:56:04 -07:00 committed by GitHub
parent 684c10937a
commit e84a341243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ const isrun = process.argv.length > 1 && process.argv[1] === import.meta.path;
if (isrun) {
const file = Bun.file("./problem.txt");
const text = await file.text();
const lines = text.split("\n");
const lines = text.split("\n").filter((x) => x && x.length);
console.log("=== COMPUTATION ===\n");