Minimum number of steps needed to solve a rubik cube
Take from here:
Every position of Rubik's Cube™ can be solved in twenty moves or less.
With about 35 CPU-years of idle computer time donated by Google, a team of researchers has essentially solved every position of the Rubik's Cube™, and shown that no position requires more than twenty moves. We consider any twist of any face to be one move (this is known as the half-turn metric.)
The resulting algorithm has been called God's Algorithm and is explained here. The first page linked above even has code you can download and run on your own desktop machine.
You need a small number of subroutines. I used to solve one layer by inspection and put it on the bottom. Then you need the ability to swap one pair of corners, leaving all other corners alone. You can switch any pair of corners with one such subroutine. Say you know how to swap FLU and FRU, but want to swap BLU and FRU instead. Find and remember a series of moves to bring the corners you want to swap into FLU/FRU, do your subroutine, then undo the moves that brought the corners to FLU/FRU. This type of commutator will make your subroutines general. Then you need to rotate two corners, swap two pairs of edges, and flip a pair of edges and you are done. That is four, not three subroutines, but it is close. This won't get you an optimal solution in terms of moves or time, but it is probably optimal in terms of effort to learn.
This might help:
See the discussion and references to notation on the associated Wikipedia page Optimal solutions for Rubik's Cube.
This might be looking for: See the attached pdf: Rubik's Cube Solution. It explains notation used, and then proceeds to describe "3 layers" (subroutines) to follow for solving the Rubik's cube.