+1 vote
by
The problem is from the Yandex contest. There is a function - a generator, also encrypted, uses a sorting algorithm. I need to find a bug in it. But I can't even understand which algorithm is represented. Please, help me to understand it. Maybe someone will understand what sorting algorithm is used.
function* sort(_0x10162c, _0x3460cd = 0x1, _0x49db90 = _0x10162c.length) {
if (_0x3460cd < _0x49db90) {
const _0x2cbfe9 = yield* _0x95ac27(_0x10162c, _0x3460cd, _0x49db90)
yield* sort(_0x10162c, _0x3460cd, _0x2cbfe9 - 0x1)
yield* sort(_0x10162c, _0x2cbfe9 + 0x1, _0x49db90)
}
return _0x10162c
function* _0x95ac27(_0x48a5bb, _0x16a6ba, _0xb9f054) {
const _0x3d9560 = _0x48a5bb[_0xb9f054]
let _0x1d11c1 = _0x16a6ba
for (let _0x252cf3 = _0x16a6ba; _0x252cf3 < _0xb9f054; _0x252cf3++) {
if (_0x48a5bb[_0x252cf3] < _0x3d9560 && _0x3d9560 % 0x2) {
yield _0x526eb0(_0x48a5bb, ++_0x1d11c1, _0x252cf3)
}
}
yield _0x526eb0(_0x48a5bb, _0x1d11c1 + 0x1, _0xb9f054)
return _0x1d11c1
}
function _0x526eb0(_0x1ea4ab, _0x530ade, _0x32c8e5) {
;[_0x1ea4ab[_0x530ade], _0x1ea4ab[_0x32c8e5]] = [
_0x1ea4ab[_0x530ade],
_0x1ea4ab[_0x32c8e5],
]
;[_0x1ea4ab[_0x530ade], _0x1ea4ab[_0x32c8e5]] = [
_0x1ea4ab[_0x32c8e5],
_0x1ea4ab[_0x530ade],
]
return _0x1ea4ab
}
}
by
dollar he asks what the algorithm is, and that's all.
by
Isn't this a task by any chance?

1 Answer

+2 votes
by
it looks like quick
...