Last active
January 24, 2021 07:15
-
-
Save shu1/bb0acf14107bb783861df694b2acb010 to your computer and use it in GitHub Desktop.
foobar
This file contains hidden or 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
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or 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
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or 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
var output = "endrtednedd:/os....cp.rnnn.rhhps/.tt$sfeaiaaofd.ow.otooapa.asu./thhse"; | |
var col = output.split(''); | |
col.sort(); | |
col.push(col.shift()); | |
var table = output.split(''); | |
for (var i = table.length-1; i >= 0; --i) { | |
table[i] += col[i]; | |
} | |
var used = Array(table.length); | |
for (var i=1; i < output.length-1; ++i) { | |
used.fill(false); | |
for (var j=0; j < table.length; ++j) { | |
table[j] += nextChar(j, i); | |
} | |
} | |
console.log(table); | |
function nextChar(index, width) { | |
for (var i=0; i < table.length; ++i) { | |
match: | |
if (!used[i]) { | |
for (var j=0; j < width; ++j) { | |
if (table[i][j] != table[index][j+1]) { | |
break match; | |
} | |
} | |
used[i] = true; | |
return table[i][width]; | |
} | |
} | |
} |
This file contains hidden or 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
{"name":"foobar","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment