Two sum | Algorithm | Common Interview questions | Javascript

Publié le: 23 janvier 2021
sur la chaîne: Algorithm Galaxy
46
1

Two number sum or Two sum is a common algorithm interview question which is being asked.

In our solution we are using Javascript to solve Two sum problem, it will be the same approach for languages as well.

#twoNumberSum #twoSumProblem

Problem definition:
From the given array, EFFICIENTLY find two numbers sum together to get the target number.

Our approach:
1. Heap Map
2. Two pointer

Complexities:
Heap Map:
Time - O(n)
Space - O(n)
Two Pointer:
Time - O(n)
Space - O(1)

Chapters:

🤝 00:00 Introduction
👉 00:12 Problem definition
👉 01:00 Solution approach
👉 03:15 Heap map solution
👉 06:40 Heap map Big O
👉 08:00 Two pointer solution
👉 14:30 Two pointer Big O

Thanks for watching. Happy learning.


Sur cette page du site, vous pouvez voir la vidéo en ligne Two sum | Algorithm | Common Interview questions | Javascript durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Algorithm Galaxy 23 janvier 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 46 fois et il a aimé 1 téléspectateurs. Bon visionnage!