An algorithm is a logical, step-by-step procedure of trying solutions until you hit on the right one.
So if we're still trying to get into our email account, we might start with one, two, three, four, five, six, seven, eight, and if that doesn't work, we'll change one number at a time.
If you did solve that problem, try to think about how the solution came to you.
You probably didn't do a series of step-by-step arrangements of matches, and the heuristics we've talked about don't quite work.
And with trial and error, you're not necessarily keeping track of what you've already done, so you could get lucky and hit on the right password early, or it could take a very, very long time.
A more methodical approach would be to use the algorithm strategy.
Usually though, we don't have time to try every possible solution, so a more common method of solving problems is to use some sort of heuristic.
A heuristic is a mental shortcut that allows us to find a solution more quickly than the other two methods we've talked about so far.
Most people get stuck on thinking about this problem in a two-dimensional way. The answer, though, requires you to think about the problem in three dimensions.
You need to create a triangle pyramid with the six matches in order to form four equilateral triangles.