Twisting and turning a mixed-up Rubik’s Cube so each side ends up with squares of the same color is famously difficult. Most people quickly give up trying to master the puzzle. But a new robot figured out how to do it—one-handed.

Most robots are programmed for simple repetitive motions. But the California company OpenAI wanted to develop a robotic hand that could perform more complex tasks. Solving a Rubik’s Cube that can be scrambled into a million trillion configurations seemed like the perfect test. OpenAI’s computer scientists didn’t give the robot instructions to complete the puzzle. Instead, they trained artificial intelligence (AI) software, which learns in a way similar to how humans do.

The AI system practiced solving thousands of digital simulations. The strategies it learned allowed the robot to solve a physical puzzle in just 20 moves. People usually need at least 50.