My solutions for CTFs
0

Configure Feed

Select the types of activity you want to include in your feed.

Daliy AlpacaHack 2026/1/1

Takumi Akimoto (Jan 2, 2026, 10:53 PM +0900) 3c46e9ed 499bdae0

+109
+8
alpacahack/daily/happy-new-year/deno.json
··· 1 + { 2 + "fmt": { 3 + "semiColons": false 4 + }, 5 + "imports": { 6 + "@b-fuze/deno-dom": "jsr:@b-fuze/deno-dom@^0.1.56" 7 + } 8 + }
+57
alpacahack/daily/happy-new-year/deno.lock
··· 1 + { 2 + "version": "5", 3 + "specifiers": { 4 + "jsr:@b-fuze/deno-dom@~0.1.56": "0.1.56", 5 + "jsr:@denosaurs/plug@1.1.0": "1.1.0", 6 + "jsr:@std/encoding@1": "1.0.10", 7 + "jsr:@std/fmt@1": "1.0.8", 8 + "jsr:@std/fs@1": "1.0.21", 9 + "jsr:@std/internal@^1.0.12": "1.0.12", 10 + "jsr:@std/path@1": "1.1.4", 11 + "jsr:@std/path@^1.1.4": "1.1.4" 12 + }, 13 + "jsr": { 14 + "@b-fuze/deno-dom@0.1.56": { 15 + "integrity": "8030e2dc1d8750f1682b53462ab893d9c3470f2287feecbe22f44a88c54ab148", 16 + "dependencies": [ 17 + "jsr:@denosaurs/plug" 18 + ] 19 + }, 20 + "@denosaurs/plug@1.1.0": { 21 + "integrity": "eb2f0b7546c7bca2000d8b0282c54d50d91cf6d75cb26a80df25a6de8c4bc044", 22 + "dependencies": [ 23 + "jsr:@std/encoding", 24 + "jsr:@std/fmt", 25 + "jsr:@std/fs", 26 + "jsr:@std/path@1" 27 + ] 28 + }, 29 + "@std/encoding@1.0.10": { 30 + "integrity": "8783c6384a2d13abd5e9e87a7ae0520a30e9f56aeeaa3bdf910a3eaaf5c811a1" 31 + }, 32 + "@std/fmt@1.0.8": { 33 + "integrity": "71e1fc498787e4434d213647a6e43e794af4fd393ef8f52062246e06f7e372b7" 34 + }, 35 + "@std/fs@1.0.21": { 36 + "integrity": "d720fe1056d78d43065a4d6e0eeb2b19f34adb8a0bc7caf3a4dbf1d4178252cd", 37 + "dependencies": [ 38 + "jsr:@std/internal", 39 + "jsr:@std/path@^1.1.4" 40 + ] 41 + }, 42 + "@std/internal@1.0.12": { 43 + "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" 44 + }, 45 + "@std/path@1.1.4": { 46 + "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5", 47 + "dependencies": [ 48 + "jsr:@std/internal" 49 + ] 50 + } 51 + }, 52 + "workspace": { 53 + "dependencies": [ 54 + "jsr:@b-fuze/deno-dom@~0.1.56" 55 + ] 56 + } 57 + }
+44
alpacahack/daily/happy-new-year/solve.ts
··· 1 + import { DOMParser } from "@b-fuze/deno-dom" 2 + 3 + const TARGET = "alpacahack" 4 + const document = await fetch( 5 + "https://en.wikipedia.org/wiki/List_of_animal_names", 6 + ) 7 + .then((res) => res.text()) 8 + .then((html) => new DOMParser().parseFromString(html, "text/html")) 9 + const animalNames = new Set<string>() 10 + const tables = document.querySelectorAll("table.wikitable") 11 + 12 + for (const table of tables) { 13 + const rows = table.querySelectorAll("tr") 14 + 15 + for (const row of rows) { 16 + const firstCell = row.querySelector("td") 17 + 18 + if (!firstCell) { 19 + continue 20 + } 21 + 22 + const link = firstCell.querySelector("a") 23 + 24 + if (link) { 25 + const animalName = link.textContent.trim().toLowerCase() 26 + 27 + animalNames.add(animalName) 28 + } 29 + } 30 + } 31 + 32 + const candidates: string[] = [] 33 + 34 + for (let i = 0; i < TARGET.length; i++) { 35 + for (let j = i + 1; j <= TARGET.length; j++) { 36 + const sub = TARGET.slice(i, j) 37 + 38 + if (animalNames.has(sub)) { 39 + candidates.push(sub) 40 + } 41 + } 42 + } 43 + 44 + console.log(candidates)