![take U forward](/img/default-banner.jpg)
- 515
- 78 255 206
take U forward
India
Приєднався 16 бер 2020
Hey, I am a Software Engineer. Where? You can find that on my LinkedIn. Also, I am a Candidate Master(2020) at Codeforces and a 6*(2019) at Codechef. In this channel, I try to create content which can help some of you.
I teach DSA stuff, I try to make it as easy as possible. The best thing about this channel is, you will find the thought process behind every problem and not just simple algorithms. All of the content is in English so that anyone can watch it. I also take live sessions on a channel named CodeBeyond, and I keep posting roadmaps on my second channel "Striver"
Codeforces/Codechef: striver_79
Subscribe to the channel and press the bell 🔔 for the latest updates!
Join us at: t.me/Competitive_Programming_tuf
For Business Collabs: striver@takeuforward.org
I teach DSA stuff, I try to make it as easy as possible. The best thing about this channel is, you will find the thought process behind every problem and not just simple algorithms. All of the content is in English so that anyone can watch it. I also take live sessions on a channel named CodeBeyond, and I keep posting roadmaps on my second channel "Striver"
Codeforces/Codechef: striver_79
Subscribe to the channel and press the bell 🔔 for the latest updates!
Join us at: t.me/Competitive_Programming_tuf
For Business Collabs: striver@takeuforward.org
L13. Fractional Knapsack Algorithm
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/
Follow me on socials: linktr.ee/takeUforward
Follow me on socials: linktr.ee/takeUforward
Переглядів: 12 755
Відео
L12. Candy | Slope Approach Intuition Based
Переглядів 7 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L11. Valid Parenthesis String | Multiple Approaches
Переглядів 6 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L10. Minimum number of platforms required in a railway station
Переглядів 4,8 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L9. Insert Intervals | Greedy Algorithms Playlist
Переглядів 3,8 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L8. Non Overlapping Intervals | Greedy Algorithms Playlist
Переглядів 4,2 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L7. N Meeting in One Room | Greedy Algorithms Playlist
Переглядів 5 тис.28 днів тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L6. Job Sequencing Problem | Greedy Algorithm Playlist
Переглядів 6 тис.28 днів тому
Find problem link, notes here: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L5. Jump Game - II | Greedy Algorithm Playlist
Переглядів 10 тис.Місяць тому
Find problem link, notes in step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L4. Jump Game - I | Greedy Algorithm Playlist
Переглядів 9 тис.Місяць тому
Find problem link, notes in step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L3. Shortest Job First (or SJF) CPU Scheduling
Переглядів 8 тис.Місяць тому
Find problem link, notes in step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L2. Lemonade Change | Greedy Algorithm Playlist
Переглядів 8 тис.Місяць тому
Find problem link, notes in step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L1. Assign Cookies | Greedy Algorithm Playlist
Переглядів 24 тис.Місяць тому
Find problem link, notes under Step 12: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Follow me on socials: linktr.ee/takeUforward
L12. Minimum Window Substring | 2 Pointers and Sliding Window Playlist
Переглядів 37 тис.2 місяці тому
Notes/Codes/Problem links under step 10 of A2Z DSA Course: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Entire playlist: ua-cam.com/play/PLgUwDviBIf0q7vrFA_HEWcqRqMpCXzYAL.html Follow us on our other social media handles: linktr.ee/takeuforward
L11. Subarray with k different integers | 2 Pointers and Sliding Window Playlist
Переглядів 22 тис.2 місяці тому
Notes/Codes/Problem links under step 10 of A2Z DSA Course: takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/ Entire playlist: ua-cam.com/play/PLgUwDviBIf0q7vrFA_HEWcqRqMpCXzYAL.html Follow us on our other social media handles: linktr.ee/takeuforward
L10. Count number of Nice subarrays | 2 Pointers and Sliding Window Playlist
Переглядів 27 тис.2 місяці тому
L10. Count number of Nice subarrays | 2 Pointers and Sliding Window Playlist
L9. Binary Subarrays With Sum | 2 Pointers and Sliding Window Playlist
Переглядів 34 тис.2 місяці тому
L9. Binary Subarrays With Sum | 2 Pointers and Sliding Window Playlist
L8. Longest Repeating Character Replacement | 2 Pointers and Sliding Window Playlist
Переглядів 34 тис.2 місяці тому
L8. Longest Repeating Character Replacement | 2 Pointers and Sliding Window Playlist
L7. Number of Substrings Containing All Three Characters | 2 Pointers and Sliding Window Playlist
Переглядів 24 тис.2 місяці тому
L7. Number of Substrings Containing All Three Characters | 2 Pointers and Sliding Window Playlist
L6. Longest Substring With At Most K Distinct Characters | 2 Pointers and Sliding Window Playlist
Переглядів 19 тис.2 місяці тому
L6. Longest Substring With At Most K Distinct Characters | 2 Pointers and Sliding Window Playlist
L5. Fruit Into Baskets | 2 Pointers and Sliding Window Playlist
Переглядів 27 тис.2 місяці тому
L5. Fruit Into Baskets | 2 Pointers and Sliding Window Playlist
L4. Max Consecutive Ones III | 2 Pointers and Sliding Window Playlist
Переглядів 36 тис.2 місяці тому
L4. Max Consecutive Ones III | 2 Pointers and Sliding Window Playlist
L3. Longest Substring Without Repeating Characters | 2 Pointers and Sliding Window Playlist
Переглядів 57 тис.2 місяці тому
L3. Longest Substring Without Repeating Characters | 2 Pointers and Sliding Window Playlist
L2. Maximum Points You Can Obtain from Cards | 2 Pointers and Sliding Window Playlist
Переглядів 36 тис.2 місяці тому
L2. Maximum Points You Can Obtain from Cards | 2 Pointers and Sliding Window Playlist
L1. Introduction to Sliding Window and 2 Pointers | Templates | Patterns
Переглядів 104 тис.2 місяці тому
L1. Introduction to Sliding Window and 2 Pointers | Templates | Patterns
L8. Smallest Prime Factor (SPF) | Prime Factorisation | Query Based Problem | Maths Playlist
Переглядів 13 тис.3 місяці тому
L8. Smallest Prime Factor (SPF) | Prime Factorisation | Query Based Problem | Maths Playlist
L7. Count Prime in a range L-R | Maths Playlist
Переглядів 7 тис.3 місяці тому
L7. Count Prime in a range L-R | Maths Playlist
L6. Sieve of Eratosthenes | Maths Playlist
Переглядів 19 тис.3 місяці тому
L6. Sieve of Eratosthenes | Maths Playlist
L5. Power Exponentiation | Maths Playlist
Переглядів 12 тис.3 місяці тому
L5. Power Exponentiation | Maths Playlist
L4. Print all prime factors of a Number | Maths Playlist
Переглядів 18 тис.3 місяці тому
L4. Print all prime factors of a Number | Maths Playlist
understood
🙇♀🙇♀🙇♀🙇♀🙇♀🙇♀
Thank you for great video, we can avoid repeating the same code in both methods for finding the firstIndex and last using a simple boolean. flag: public int[] searchRange(int[] nums, int target) { int[] ans = {-1,-1}; if(nums.length == 0){ return ans; } int startIndex = search(nums, target, true); int endIndex = search(nums, target, false); ans[0] = startIndex; ans[1] = endIndex; return ans; } int search(int[] nums, int target, boolean findFirstIndex){ int ans = -1; int start = 0; int end = nums.length; while(start <= end){ int mid = (start + end) / 2; if (mid >= nums.length) return ans; if (target < nums[mid]) end = mid - 1; else if (target > nums[mid]) start = mid + 1; else { ans = mid; if (findFirstIndex) end = mid -1; else start = mid + 1; } } return ans; }
understood
ty sir
us
Understood
GOAT
understood
wtffffffffffffff
understood
Sir tussee great ho🫡❤️
ty sir
if anyone needs corrected code string minWindow(string s, string t) { int right=0, left=0, n = s.size(); map<char,int> mp; for(auto i : t){ mp[i]++; } int minLen = INT_MAX; int startInd = -1; int cnt = 0; int m = t.size(); while(right<n){ if(mp[s[right]]>0) cnt++; mp[s[right]]--; while(cnt==m){ if(minLen>right-left+1){ minLen = right-left+1; startInd = left; } mp[s[left]]++; if(mp[s[left]]>0) cnt--; left++; } right++; } if(startInd==-1) return ""; return s.substr(startInd,minLen); }
Understood! Thanks a lot Striver.
done 26/6
understood!
what when one of the value is not present in tree
you are amazing sir
thats amazing
For the base case, couldnt you just write , for(int i=1;i<=n;i++){ if(pattern[i-1]=='*' && dp[i-1][0]==1){ dp[i][0]=1; }else{ dp[i][0]=0; } }
Brilliant explanation and hats off to whoever though of this solution.
Understood!
understood
The way he explained made me to think how to really approach a problem with logical thinking...Great Striver!!!
Understood!
public static ArrayList<Integer> Intersection(int[] arr,int[] arr2,int n,int n2){ Set<Integer> set1=new HashSet<Integer>(); Set<Integer> intersect=new HashSet<Integer>(); for(int i=0;i<n;i++){ set1.add(arr[i]); } for(int i=0;i<n2;i++){ if(set1.contains(arr2[i])){ intersect.add(arr2[i]); } } ArrayList<Integer> a=new ArrayList<Integer>(intersect); return new ArrayList<Integer>(a); } Can we use intersection using this ???
class Solution { public: int lengthOfLongestSubstring(string s) { int n = s.length(), l = 0, r = 0, cnt = 0; unordered_set<char> seen; if (n == 0) return 0; while (r < n) { if (r < n && seen.find(s[r]) == seen.end()) { seen.insert(s[r]); cnt = max(cnt, r - l + 1); r++; } else { seen.erase(s[l]); l++; } } return cnt; } };
us
Understood
Understood
Striver I am from West Bengal. You are god of problem solving!! ❤❤❤❤❤❤
ud
Pivattt!
Pivaattt!
Understood
left + right kyu nhi kiya isme
thank you brother for this kinda of efforts !!! definitely it will help me a lot to get placed in reputed company🤗🤩
This is the first video that I have not understood of you. No matter how many times I watch I just can't understand. I'm just skipping this optimal approach for now. :)
thank you for expaination
you are amazing sir
alt approach: consider the stones as the nodes in dsu, instead of considering the rows/cols (can optimize the visited array size, i was just lazy) code-> (AC on LC) class DS { public: vector<int>parent,size; DS(int n) { size.resize(n,1); parent.resize(n); for(int i=0; i<n; i++) parent[i]=i; } int findUPar(int node) { if(parent[node]==node) return node; else return parent[node]=findUPar(parent[node]); } void unionBySize(int x, int y) { int ulp_x=findUPar(x); int ulp_y=findUPar(y); if(ulp_x==ulp_y) return; else if(size[ulp_x]>=size[ulp_y]) parent[ulp_y]=ulp_x, size[ulp_x]+=size[ulp_y]; else parent[ulp_x]=ulp_y, size[ulp_y]+=size[ulp_x]; } }; class Solution { public: int removeStones(vector<vector<int>>& stones) { //there are n stones, so I am making a dsu with the nodes as the n stones int n=stones.size(); //the coords can be anything from 0 to 1e4 //also the rows and cols need to be dealt separately as visited vector<int>visX(1e4+1,-1), visY(1e4+1,-1); DS dsu(n); for(int i=0; i<n; i++) { int x=stones[i][0], y=stones[i][1]; if(visX[x]==-1) visX[x]=i; else dsu.unionBySize(visX[x], i); if(visY[y]==-1) visY[y]=i; else dsu.unionBySize(visY[y], i); } //we can remove size-1 nodes from each connected component int ans=0; for(int i=0; i<n; i++) { if(dsu.parent[i]==i) ans+=dsu.size[i]-1; } return ans; } };
a very very thankyou for this playlist..from playlist to video and cheatsheet everything is just well managed...even paid courses doesn't provides what u r providing for free❤ and the biggest thank you to make this content as language independent and provide solutions in java too...❤
Presense of negative edge does not always result incorrect result ...that could be easily proved in the second example if there is a path say from 4 to 3 with -1 edge weight ....but if the negative edge cycle change the previous path length which we got after n-1 iteration then it cause problem.
nice explaination
Understood
us
Awesome
Understood
thankyou so much sir