There are only 4 possible Solved structure/formation.

Now, let's calculate and store the number of rotations needed for each of the 4 formations in an array $Sum$ of length 4.

For each of the 4 formations, you just need to subtract the number of rotations needed before rotation and add number of rotations needed after rotation of the $(i, j)^{th} $ cell that Robi Kaka rotates. Note that you don't need to calculate for the whole structure. Because only one cell is rotated.

Contributors

Statistics

85% Solution Ratio
akash740Earliest, Mar '21
steinumFastest, 0.0s
steinumLightest, 5.5 kB
Zobayer_AbedinShortest, 1349B
Toph uses cookies. By continuing you agree to our Cookie Policy.