3Sum (LeetCode) | Interview Question Algorithm Explanation

preview_player
Показать описание

Notes:
1. Why don't we use a hashmap as in the original Two Sum problem?
A. This is because we can find a better approach, once we've sorted the array - that allows us to solve the problem with the same (and in some cases better) time complexity, while using CONSTANT SPACE.

2. Why do we run the while loops to skip similar elements?
A. We don't want duplicates in the problem set

Timestamps:
00:00 - Problem Introduction
01:14 - Algorithm Approach
03:07 - Coding Walkthrough

_______________________________________
Some great channels to learn more:
Рекомендации по теме
join shbcf.ru