A
A
Alexander Buki2020-10-24 02:01:14
JavaScript
Alexander Buki, 2020-10-24 02:01:14

What is the sorting algorithm?

Task from Yandex contest. There is a function - a generator, also encrypted, uses a sorting algorithm. We need to find a bug in it. But I can't even figure out what algorithm is presented. Help me figure it out plz. 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
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-10-24
@0xD34F

similar to quick

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question