Skip to content

Instantly share code, notes, and snippets.

@spacelatte
Created September 29, 2019 17:10
Show Gist options
  • Save spacelatte/f460dabd975ab13ab8bc8be28b68e516 to your computer and use it in GitHub Desktop.
Save spacelatte/f460dabd975ab13ab8bc8be28b68e516 to your computer and use it in GitHub Desktop.
async function fn() {
let split = (await fetch("").then(x => x.text())).split("-")
return (await fetch("", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ answer: JSON.parse(split[0].replace(/'/g, '"')).map(x => isNaN(parseInt(x)) ? x : parseInt(x)).sort((a, b) => ((typeof(a) === typeof(b)) ? ((a === b) ? 0 : ((a > b) ? +1 : -1)) : ((split[2].search("Number") > 0) ? ((typeof(a) === "number") ? -1 : +1) : ((typeof(a) === "string") ? -1 : +1)))), }),
}).then(x => x.text()).then(x => (x.search("STMCTF") >= 0) ? alert(x) : x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment