nC2 Algorithm

preview_player
Показать описание
This short treats the common and intuitive well know n choose 2 algorithm as a good tool to have in your bag during a tech interview.

The algorithm works using 2 simple for loops, and will at least provide a brute force solution for many optimization problems involving collections.

It is often the case that this basic algorithm can be optimized to get a good answer to many problems optimization problems.

In this short, we cover an example problem that is to find the longest substring of the same character in a string.
Рекомендации по теме