Created
October 14, 2022 11:53
-
-
Save xnuk/c06724435ff4301f4b16a7932fa618f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy( | |
(() => { | |
const a = {} | |
for ( | |
const el | |
of document.querySelectorAll('#problem-body .sampledata[id^=sample-]') | |
) { | |
const m = el.id.match(/^sample-(input|output)-([0-9]+)$/) | |
if (m == null) continue | |
const o = (a[m[2]] ??= {}) | |
o[m[1]] = el.textContent | |
} | |
return JSON.stringify(a, null, 2) | |
})() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment