Editorial for Jewel the Magician

The main task of this problem is to perform swaps. The simplest way to swap two numbers A and B is as follows:

  1. Take a temporary variable C.

  2. Assign A to C.

  3. Copy B to A.

  4. Copy C to B.

Swapping can also be performed without the temporary C. Why?

Setter’s Complexity: O(S)

    Statistics


    68% Solution Ratio

    anonyo.akandEarliest, 3M ago

    nnnnnnFastest, 0.0s

    serotoninLightest, 131 kB

    anonyo.akandShortest, 166B

    Toph uses cookies. By continuing you agree to our Cookie Policy.