Folks here are mentioning the algorithms to solve a cube, and that’s correct of course (it’s how I know how to solve it)
As far as a “few seconds”, I suggest watching a video of a speed cube solver for the time before the clock starts. They are given a scrambled cube and are allowed to look at it for a moment. *This* is when the solving happens: they solve it in their mind first. Then the timed part becomes “did you select all the right moves and how fast can you actually perform the moves”.
Latest Answers