Decipher Algorithms with Saptarshi
Decipher Algorithms with Saptarshi
  • 43
  • 24 817
Leetcode Weekly Contest 405 Problems 1 to 4 | Bit Manipulation, Trie DP | Java Implementation
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc.
00:00:00 Introduction
00:00:47 Understanding Problem 1
00:02:06 Strategy Building Problem 1 (Don't miss the in-place soln)
00:06:58 Coding Implementation Problem 1
00:09:11 Understanding Problem 2
00:09:58 Strategy Building Problem 2
00:13:07 Coding Implementation Problem 2
00:16:35 Understanding Problem 3
00:18:28 Strategy Building Problem 3
00:22:53 Coding Implementation Problem 3
00:24:08 Understanding Problem 4
00:24:59 Strategy Building Problem 4
00:37:02 Coding Implementation Problem 4
00:43:37 Closure
Contest Link: leetcode.com/contest/weekly-contest-405/
My Codeforces Profile: codeforces.com/profile/saptarshi1729
My LinkedIn Profile: www.linkedin.com/in/saptarshi-mukherjee-52660616b/
Переглядів: 440

Відео

CSES DP Problemset | Book Shop | 0/1 KNAPSACK DP | Space Reduction
Переглядів 1542 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video is on CSES Book Shop problem, based on a classic "0/1 Knapsack" DP Category. Previous foundational video: - Basic DP Concepts: ua-cam...
CSES DP Problemset | Grid Paths | 2D Number of Paths DP
Переглядів 1352 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video is on Grid Paths problem, based on a classic "No. of paths in a 2D grid". Previous foundational video: - Basic DP Concepts: ua-cam.co...
CSES DP Problemset | Remaining Digits | Min number of steps DP
Переглядів 832 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video is on Remaining Digits problem, based on a classic "Min No. of steps" DP Category. Previous foundational videos: - Basic DP Concepts:...
Codeforces Round 955 A-D | Editorial with TOURIST's solutions | Detailed Explanations
Переглядів 8982 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This is an adventurous attempt to discuss the solutions of the legendary competitive programmer TOURIST (Gennady Korotkevich) and learn stuff! 0...
CSES DP Problemset | Coin Combinations - II | 2D to 1D DP Transition
Переглядів 2832 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video is on Coin Combinations - II problem, based on a classic "No. of ways" DP Category but that gets tough due to an interesting "ordered...
CSES DP Problemset | Coin Combinations - I | DP Approach + Implementation
Переглядів 1722 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video is on Coin Combinations - I problem, based on a classic "No. of ways" DP Category. Previous foundational videos: - Basic DP Concepts:...
Minimization DP from scratch | CSES DP Problemset | Minimizing Coins | DP Approach + Live Coding
Переглядів 4893 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. Precursor: Basic DP concept - ua-cam.com/video/nynhzVBeXkU/v-deo.html Here's the second video of problem editorial from CSES problemset. 00:00:0...
Basics of DP | Recursion in depth | Memoization vs Tabulation - Which is Better?
Переглядів 1,1 тис.3 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This video covers a very significant milestone of DSA and Competitive Programming: the basics of Recursion, DP, and the types of DP implementati...
CSES DP Problemset | Dice Combinations | DP Approach + Implementations | Live Coding
Переглядів 6674 місяці тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. In this series of videos, I'll be covering how to solve DP Problems using the awesome CSES Problemset. Each explanation shall be followed by Liv...
Codeforces Round 937 (Div 4) | Problems A - G | Live Coding and Commentary
Переглядів 2 тис.5 місяців тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. 00:00:00 Introduction 00:03:34 Problem A 00:03:48 Live Coding A 00:05:57 Problem B 00:06:37 Logic discussion B 00:07:59 Live Coding B 00:09:46 A...
Codeforces Round 934 Problems A to D Editorial | Live coding
Переглядів 6836 місяців тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. 00:00:00 Introduction 00:00:33 How my contest went 00:02:50 Problem A 00:04:20 Intuition Building 00:12:26 Live coding in Java 00:13:45 Problem ...
Codeforces Educational Round 163 Editorial
Переглядів 5086 місяців тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. 00:00:00 Introduction 00:01:10 How my contest went 00:01:48 Problem A 00:03:41 Intuition Building and solution 00:10:41 Problem B 00:13:47 Intui...
DP + Prefix Tricks | Buy and Sell Stocks IV | LC Hard Problem | Codeforces Round 932 Problem C
Переглядів 8846 місяців тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This session is on a very frequently appearing topic on CP contests: DP Prefix Tricks. Please share with your friends who may find this informat...
Codeforces Round 932 Editorial (B, C, D, E) with TOURIST's Solutions | Saptarshi Mukherjee
Переглядів 9936 місяців тому
Hello everyone, I'm Saptarshi Mukherjee, a Software Engineer III at Google and a Competitive Programmer with some titles like 3 times ACM-ICPC Regionals, Former Master at Codeforces, and 6 star at Codechef, Former Educator and Mentor at Unacademy, etc. This is an attempt to discuss the solutions of the legendary competitive programmer TOURIST (Gennady Korotkevich) in Codeforces Round 932 and le...
Codeforces Round 930 Editorial (D, E) | Saptarshi Mukherjee
Переглядів 5536 місяців тому
Codeforces Round 930 Editorial (D, E) | Saptarshi Mukherjee
Codeforces Round 930 Editorial (A, B, C) | Saptarshi Mukherjee
Переглядів 4496 місяців тому
Codeforces Round 930 Editorial (A, B, C) | Saptarshi Mukherjee
DP on Trees | Coin DP in Tree | Problem E of Codeforces Edu Round 162 (Div 2)
Переглядів 1,9 тис.6 місяців тому
DP on Trees | Coin DP in Tree | Problem E of Codeforces Edu Round 162 (Div 2)
Codeforces Round 927 Editorial (F, G) with TOURIST's Solutions | Saptarshi Mukherjee
Переглядів 2,2 тис.6 місяців тому
Codeforces Round 927 Editorial (F, G) with TOURIST's Solutions | Saptarshi Mukherjee
Codeforces Round 927 Editorial (C, D, E) with TOURIST's Solutions | Saptarshi Mukherjee
Переглядів 2,4 тис.6 місяців тому
Codeforces Round 927 Editorial (C, D, E) with TOURIST's Solutions | Saptarshi Mukherjee
Leetcode Weekly Contest 385 Problems 1 & 4 - Count Prefix and Suffix Pairs | Saptarshi Mukherjee
Переглядів 1927 місяців тому
Leetcode Weekly Contest 385 Problems 1 & 4 - Count Prefix and Suffix Pairs | Saptarshi Mukherjee
Leetcode Weekly Contest 385 Problem 3 - Most Frequent Prime | Saptarshi Mukherjee
Переглядів 777 місяців тому
Leetcode Weekly Contest 385 Problem 3 - Most Frequent Prime | Saptarshi Mukherjee
Leetcode Weekly Contest 385 Problem 2 - Length of Longest Common Prefix | Saptarshi Mukherjee
Переглядів 1537 місяців тому
Leetcode Weekly Contest 385 Problem 2 - Length of Longest Common Prefix | Saptarshi Mukherjee
Leetcode Weekly Contest - 385 Short Summary | Saptarshi Mukherjee
Переглядів 787 місяців тому
Leetcode Weekly Contest - 385 Short Summary | Saptarshi Mukherjee
Codeforces Round 923 | Problems B, C, D | Saptarshi Mukherjee
Переглядів 1617 місяців тому
Codeforces Round 923 | Problems B, C, D | Saptarshi Mukherjee
Codeforces Round 923 | Problem F (Microcycle) using 2 Different Approaches | Saptarshi Mukherjee
Переглядів 3047 місяців тому
Codeforces Round 923 | Problem F (Microcycle) using 2 Different Approaches | Saptarshi Mukherjee
Codeforces Round 923 | Problem G (Paint Charges) | Saptarshi Mukherjee
Переглядів 4917 місяців тому
Codeforces Round 923 | Problem G (Paint Charges) | Saptarshi Mukherjee
Codeforces Round 923 - Short Summary | Saptarshi Mukherjee
Переглядів 1737 місяців тому
Codeforces Round 923 - Short Summary | Saptarshi Mukherjee
Codeforces Round 923 | Problem A (Make it White) | Saptarshi Mukherjee
Переглядів 777 місяців тому
Codeforces Round 923 | Problem A (Make it White) | Saptarshi Mukherjee
Codeforces Round 923 | Problem E (Klever Permutation) | Saptarshi Mukherjee
Переглядів 1597 місяців тому
Codeforces Round 923 | Problem E (Klever Permutation) | Saptarshi Mukherjee

КОМЕНТАРІ

  • @olid_hussan
    @olid_hussan 18 днів тому

    best explantion sir ,, thanks

  • @sanchitkumar6626
    @sanchitkumar6626 25 днів тому

    Sir please post some new vidio .Your vidio teaches a lot please come with some dp on tree ,rerooting or in out dp content

  • @fardinsamy9872
    @fardinsamy9872 Місяць тому

    really helped a lot .

  • @mrcow6531
    @mrcow6531 Місяць тому

    pls complete this playlist

    • @saptarshimukherjee3908
      @saptarshimukherjee3908 Місяць тому

      @@mrcow6531 hey thanks for the comments. Sorry to share, I've stopped working on this... All the best!

  • @sanchitkumar6626
    @sanchitkumar6626 Місяць тому

    i am newbie but still i watching D,E problem because your explanation is really good.

  • @talukdersiam9709
    @talukdersiam9709 Місяць тому

    thats called the explanation of dp .Any level of programmer can understand how you understand this .bro do not stop making like this video though your video view is less .

  • @sanchitkumar6626
    @sanchitkumar6626 Місяць тому

    The way of approaching questions IS really outstanding.

  • @priyanshupandey4897
    @priyanshupandey4897 Місяць тому

    Thanks sir

  • @SharQawyCS
    @SharQawyCS Місяць тому

    What is the macbook do you use please

  • @shootingcardinal3578
    @shootingcardinal3578 Місяць тому

    Hi, I really like your explanation and approach. Could you please share the pdf of what you have explained in the video (in fact all the videos)? It would be really helpful for me. Looking forward for more such amazing content!

  • @mrcow6531
    @mrcow6531 Місяць тому

    Hello Sir, My C++ recursive code giving TLE for two large cases can you pls review it :) //? Coin combinations CSES problem set #include <bits/stdc++.h> using namespace std ; #define MOD 1000000007 #define ll long long ll rec(vector <ll> &v , ll target , vector <ll> &memo) { if( memo[ target ] > 0) return memo[target] ; if(target == 0) return 1 ; ll sum = 0 ; for(ll i = 0 ; i < v.size() ; i ++) { if(target - v[i] < 0) break; sum += rec(v , target - v[i] , memo) ; sum = sum % MOD ; } memo[target] = sum ; return sum ; } int main () { ll n , x ; cin >> n >> x ; vector <ll> v(n) ; for(ll i = 0 ; i < n ; i++) cin >> v[i] ; sort(v.begin() , v.end()) ; vector <ll> memo (x + 1 , -1) ; memo[0] = 1 ; ll ans = rec(v , x , memo) ; cout << ans ; }

  • @mrcow6531
    @mrcow6531 2 місяці тому

    Hey pls upload more

  • @ninadpatil8606
    @ninadpatil8606 2 місяці тому

    completed the whole playlist It's hard to find such good content on UA-cam....request please complete the whole cses dp problems dada!!

  • @mrcow6531
    @mrcow6531 2 місяці тому

    Pls upload more

  • @mrcow6531
    @mrcow6531 2 місяці тому

    upload pls

  • @mrcow6531
    @mrcow6531 2 місяці тому

    upload more pls

  • @adityaghosh6170
    @adityaghosh6170 2 місяці тому

    19:56 For 9, wouldn't the dp formulation turn out to be 1+min(3,1,3) instead of 1+min(5,1,3) as the minimum number of coins required to reach a sum of 9 is 1+1+7 i.e 3.

  • @telugufreaks14206
    @telugufreaks14206 2 місяці тому

    My honest review is not to make videos so long for these type of questions But good content 😊

  • @adityaghosh6170
    @adityaghosh6170 2 місяці тому

    Watched the video completely. Probably the most lucid video on DP present on YT. Thank you for sharing your knowledge. It was indeed really helpful.

  • @saketshaurya750
    @saketshaurya750 2 місяці тому

    beautiful ..wow wow wow

  • @Alain-g8z
    @Alain-g8z 2 місяці тому

    just 0/1 knapsack

  • @Aaron.sharon
    @Aaron.sharon 2 місяці тому

    How is this solution sir? var getEncryptedString = function(s, k) { let len = s.length if(k === len) return s; if(k > len) { k = k % len } return s.slice(k) + s.substring(0,k) };

    • @saptarshimukherjee3908
      @saptarshimukherjee3908 2 місяці тому

      hey yeah, this is the standard solution, and it's correct. If you're asked to make changes within the same string (please check if it's possible for a js string, otherwise imagine a character array), then my technique shall help.

  • @Aaron.sharon
    @Aaron.sharon 2 місяці тому

    Great content sir. I am a junior developer and started my junior this month. I am very poor in DSA but now I am solving some problems in leetcode, can you please do this in javascript?

    • @saptarshimukherjee3908
      @saptarshimukherjee3908 2 місяці тому

      Thanks! I believe you can translate each step from Java/C++ to JS. That shall ensure that you understand each line of code well and you're translating to Java. You may ask in the comments if you face any specific challenges. Cheers!

  • @ninadpatil8606
    @ninadpatil8606 2 місяці тому

    why java ??😭😭😭😭😭

    • @saptarshimukherjee3908
      @saptarshimukherjee3908 2 місяці тому

      Haha I don't use any strong Java-specific thing. I can make in C++ as well, 90% of the code would look the same.

  • @aakshatmalhotra8088
    @aakshatmalhotra8088 2 місяці тому

    struct customPair{ long long paths; map<int, int> freq; // store frquency of colors customPair(long long &paths, map<int, int> &freq){ this -> paths = paths; this -> freq = freq; } }; customPair dfs(int node, int parent, vector<vector<int>>&adj, vector<int> &colors){ long long ans = 0; int currColor = colors[node]; map<int, int> freq; for (auto child: adj[node]){ if (child == parent) continue; customPair cAns = dfs(child, node, adj, colors); ans += cAns.paths; map<int, int> &childFreq = cAns.freq; ans += childFreq[currColor]; if (childFreq.size() > freq.size()){ freq.swap(childFreq); } for (auto color: childFreq){ if (color.first == currColor) continue; ans += childFreq[color.first] * freq[color.first]; freq[color.first] += childFreq[color.first]; } } freq[currColor] = 1; return customPair(ans, freq); } void solve(){ int n; cin>> n; vector<int> colors(n + 1); for (int i = 1; i <= n; i++) cin >> colors[i]; vector<vector<int>> adj(n + 1); for (int i = 0; i < n - 1; i++){ int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } customPair ans = dfs(1, -1, adj, colors); cout << ans.paths << nline; } This is giving TLE on 15th test case in C++

  • @user-eq3mj5sd9f
    @user-eq3mj5sd9f 2 місяці тому

    bhai please yaar regular karo yaar india me quality explainer kum hi hai

  • @ninadpatil8606
    @ninadpatil8606 2 місяці тому

    Bhayya please continue your dp cses problemset

  • @priyanshuanand84
    @priyanshuanand84 2 місяці тому

    Great work Sir

  • @thegamealexander7165
    @thegamealexander7165 2 місяці тому

    great explanation sir

  • @Algorithmswithsubham
    @Algorithmswithsubham 2 місяці тому

    please make videos on advenced topic in cp

  • @pragyakumari2030
    @pragyakumari2030 2 місяці тому

    Noice explained ❤

  • @shivangyadav5887
    @shivangyadav5887 2 місяці тому

    appreciate your efforts ❤

  • @Anonymous____________A721
    @Anonymous____________A721 2 місяці тому

    Y r u laughing

  • @aryan6470
    @aryan6470 2 місяці тому

    Bhaiya beech beech k contest misa ho jate apse bhabhi ki kasam doobara du kya 🙂

  • @ninadpatil8606
    @ninadpatil8606 3 місяці тому

    bhayya please continue why have you stopped??

    • @saptarshimukherjee3908
      @saptarshimukherjee3908 3 місяці тому

      Just uploaded one, will try to complete the series. Thanks for reminding!

  • @ichigokuro3986
    @ichigokuro3986 3 місяці тому

    Hey can you make a video on setting up Java env for competitive programming?

  • @farhantanvir479
    @farhantanvir479 3 місяці тому

    I was grinding with this question for the last 3days. I'm also weaker in bit operation and bit intuition. And YOUR VIDEO CAME AS A SAVIOR. I got the clearest understanding of xor operation and bit intuition. Thanks a tonnnnnnn!.

  • @ninadpatil8606
    @ninadpatil8606 3 місяці тому

    please continue sir

  • @hkrai1372
    @hkrai1372 3 місяці тому

    thnx a lot. nice video. also if possible explain some recent cf dp question 1800+ in practice session . ur explaination skills are very good.

  • @sumitsoni8596
    @sumitsoni8596 3 місяці тому

    Please continue this series

  • @Algorithmswithsubham
    @Algorithmswithsubham 3 місяці тому

    Darun video dada

  • @korigamik
    @korigamik 3 місяці тому

    bro stop fucking flexing yourself at the start of every video. It's sounds so scummy to start off with self appraisal.

  • @vipulsingh8260
    @vipulsingh8260 3 місяці тому

    great series keep on continuing with this amazing series . Would love on your take on how to improve in CP

  • @pratyushkumar2843
    @pratyushkumar2843 3 місяці тому

    I was thinking of another lecture after your first one on dp and went to check it came or not saw this uploaded exact that moment.... cool😅...

  • @channel-te5vk
    @channel-te5vk 3 місяці тому

    Subscribed. Bhaiya Nice way of teaching. If possible after this series make one on Binary Search on answer

  • @debanjanbarman7212
    @debanjanbarman7212 3 місяці тому

    Great Explanation dada.

  • @anubhavtyagi13
    @anubhavtyagi13 3 місяці тому

    Great Explanation!

  • @anupamkasturia3821
    @anupamkasturia3821 3 місяці тому

    Please continue this series.Great work

  • @BhuminjaySoniBCS
    @BhuminjaySoniBCS 3 місяці тому

    A great explaination!

  • @jillurrahmanriyad3103
    @jillurrahmanriyad3103 3 місяці тому

    Bring a total playlist for an absolute beginner in DP :)