Algorithm challenges are effective because there are more than one way to solve them. This opens the possibility for decisions to be made and the calculus of those decisions. When solving an algorithm problem, we should challenge ourselves to look at the problem definition from multiple perspectives, then weigh the benefits and demerits of various approaches. With enough practice, we might even glimpse a universal truth: there’s no “perfect” solution.
Let’s take Big O as an example: The most optimum algorithm scales in constant time and space. This means it does not care at all about the growth of its inputs. Next best is logarithmic time or space, then linear, linearithmic, quadratic, and exponential. The worst is factorial time or space.
However, Big O ignores constant factors when in actual practice may matter. Moreover, optimizing for time and space may increase implementation time or negatively impact code readability. When designing the structure and logic of an algorithm, the intuitive feel for what is truly negligible is as important.
More examples of algorithms and their explanations you can find here.