Permutation – position (order) matters. = N! / (N – r)!. Building words with {a,b,c} are also permutation problem with r = {1,2,3..N} Combination – position (order) doesn’t matter = N! / (N – r)! * r! . Combination is a part of Permutation set. All possible combination means, generating combination for r = {0,1.. […]
Month: June 2020
System Design links
https://github.com/donnemartin/system-design-primer https://github.com/binhnguyennus/awesome-scalability https://www.naniz.co/posts/2020/12/system-design-algorithm-and-interview-cheat-sheet https://www.bennadel.com/blog/3467-the-not-so-dark-art-of-designing-database-indexes-reflections-from-an-average-software-engineer.htm https://www.microsoft.com/en-us/research/wp-content/uploads/2017/09/Kafka.pdf https://www.youtube.com/watch?v=YPbGW3Fnmbc https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/saga/saga https://docs.google.com/document/d/1HkagusVJhCWrdu0lIF0O8foEqybrAnT38cGZIio_oME/edit?usp=sharing
Important and Useful links from all over the Leetcode
List of all good posts on Leetcode. Comment down whichever I am missing and I will add all of them here – DP for beginners by @wh0ami – https://leetcode.com/discuss/general-discussion/662866/dp-for-beginners-problems-patterns-sample-solutions[LIST – https://leetcode.com/list/x1k8lxi5] Graph for beginners by @wh0ami – https://leetcode.com/discuss/general-discussion/655708/graph-for-beginners-problems-pattern-sample-solutions/562734[LIST – https://leetcode.com/list/x1wy4de7] Sliding window for beginners by @wh0ami – https://leetcode.com/discuss/general-discussion/657507/sliding-window-for-beginners-problems-template-sample-solutions/562721[LIST – https://leetcode.com/list/x1lbzfk3] DP Patterns by @aatalyk – https://leetcode.com/discuss/general-discussion/458695/dynamic-programming-patterns Leetcode patterns from edu_cative_dot_io by @late_riser […]
Leetcode – 78. Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Solution:
Binary Left Shift << and Right Shift >>
Binary Left Shift << When shifting left, the most-significant bit is lost, and a 0 bit is inserted on the right end. Left shift is equivalent to multiplying the bit pattern by 2k (if we are shifting k bits). 10 << 2 = 10 * 22 = 10 * 4 = 40 10 << 3 = 10 […]