4Sum II | Leetcode December Challenge Day 17 | Leetcode 454 | Live coding session

preview_player
Показать описание
1) 0:00 Explaining the problem out loud
2) 1:57 Algorithm walkthrough
3) 5:55 Coding it up
4) 9:10 Time complexity

TC :O(n2)
SC :O(n2) For storing all the combinations of sum for 2 arrays
where n is the no of elements in input tree

Рекомендации по теме
Комментарии
Автор

Thanks for great explanation. Could you pls explain that why we are taking the count+= , it should be count *=, as per the permutaion logic, if there are A ways of doing thing1 and B ways of doing thing2, then total number of ways is A*B ? Please correct me if I am wrong.

ChandraShekhar-bycd
welcome to shbcf.ru