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
/* | |
0 | |
1 1 | |
1 1 1 | |
1 1 1 1 | |
1 1 1 1 1 | |
| | |
v |
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
(function (n, m) { | |
if (typeof m === 'undefined') { m = 1; } | |
if (typeof n === 'undefined') { throw new TypeError("Provide at least first number"); } | |
function randSort () { | |
return Math.random() * 2 - 1; | |
} | |
function getArr(n) { | |
var a = []; | |
for (var i = 1; i <= n; i++) { a.push(i); } |
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
(function decompress (s) { | |
var i, c, out = "", len, offset; | |
for (i = 0; i < s.length; i++) { | |
c = s.charCodeAt(i); | |
if (c >= 256 && c <= 288) { | |
len = c - 256; | |
offset = s.charCodeAt(++i); | |
out += out.substr(-offset, len); | |
} else { | |
out += s.charAt(i); |
NewerOlder