take U forward
take U forward
  • 515
  • 78 255 206
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
Переглядів: 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

КОМЕНТАРІ

  • @harishthoie5861
    @harishthoie5861 11 годин тому

    understood

  • @charuprabha9696
    @charuprabha9696 11 годин тому

    🙇‍♀🙇‍♀🙇‍♀🙇‍♀🙇‍♀🙇‍♀

  • @JalalMujawar
    @JalalMujawar 11 годин тому

    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; }

  • @free.channel715
    @free.channel715 12 годин тому

    understood

  • @KartikeyTT
    @KartikeyTT 12 годин тому

    ty sir

  • @HoneySingh-yp7zc
    @HoneySingh-yp7zc 12 годин тому

    us

  • @SHIVENDRAPATERIYA
    @SHIVENDRAPATERIYA 12 годин тому

    Understood

  • @debjitdutta17
    @debjitdutta17 12 годин тому

    GOAT

  • @VipinChauhan-t6n
    @VipinChauhan-t6n 13 годин тому

    understood

  • @eee_05_debjitdutta45
    @eee_05_debjitdutta45 13 годин тому

    wtffffffffffffff

  • @sidusaini4658
    @sidusaini4658 14 годин тому

    understood

  • @nikhilagrawal6687
    @nikhilagrawal6687 14 годин тому

    Sir tussee great ho🫡❤️

  • @KartikeyTT
    @KartikeyTT 14 годин тому

    ty sir

  • @tanaygada914
    @tanaygada914 15 годин тому

    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); }

  • @SachinKumar-zs6hm
    @SachinKumar-zs6hm 15 годин тому

    Understood! Thanks a lot Striver.

  • @Codro09
    @Codro09 16 годин тому

    done 26/6

  • @arkrajkundu8760
    @arkrajkundu8760 16 годин тому

    understood!

  • @mohammadtalha360
    @mohammadtalha360 16 годин тому

    what when one of the value is not present in tree

  • @dheerajshukla7008
    @dheerajshukla7008 16 годин тому

    you are amazing sir

  • @dheerajshukla7008
    @dheerajshukla7008 16 годин тому

    thats amazing

  • @lohesh9822
    @lohesh9822 16 годин тому

    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; } }

  • @pranavmisra5870
    @pranavmisra5870 16 годин тому

    Brilliant explanation and hats off to whoever though of this solution.

  • @krishnaa5559
    @krishnaa5559 16 годин тому

    Understood!

  • @havefunwithshort
    @havefunwithshort 16 годин тому

    understood

  • @trailblazer555
    @trailblazer555 16 годин тому

    The way he explained made me to think how to really approach a problem with logical thinking...Great Striver!!!

  • @aldoc2663
    @aldoc2663 16 годин тому

    Understood!

  • @_AMARNATHM
    @_AMARNATHM 16 годин тому

    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 ???

  • @aggarwalsachin4854
    @aggarwalsachin4854 16 годин тому

    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; } };

  • @HoneySingh-yp7zc
    @HoneySingh-yp7zc 17 годин тому

    us

  • @user-jk3ts7tz7u
    @user-jk3ts7tz7u 17 годин тому

    Understood

  • @AadarshWadile-om8ew
    @AadarshWadile-om8ew 17 годин тому

    Understood

  • @arnabmondal81
    @arnabmondal81 17 годин тому

    Striver I am from West Bengal. You are god of problem solving!! ❤❤❤❤❤❤

  • @vaishnavirathore5579
    @vaishnavirathore5579 17 годин тому

    ud

  • @PrachiShinde-lu2fg
    @PrachiShinde-lu2fg 17 годин тому

    Pivattt!

  • @PrachiShinde-lu2fg
    @PrachiShinde-lu2fg 17 годин тому

    Pivaattt!

  • @mridulsingh5784
    @mridulsingh5784 17 годин тому

    Understood

  • @funfouryou712
    @funfouryou712 17 годин тому

    left + right kyu nhi kiya isme

  • @MaheshKumarS-mt6ot
    @MaheshKumarS-mt6ot 17 годин тому

    thank you brother for this kinda of efforts !!! definitely it will help me a lot to get placed in reputed company🤗🤩

  • @harshhwardhanrai3716
    @harshhwardhanrai3716 17 годин тому

    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. :)

  • @bhanderidhruvbhanderidhruv557
    @bhanderidhruvbhanderidhruv557 17 годин тому

    thank you for expaination

  • @dheerajshukla7008
    @dheerajshukla7008 17 годин тому

    you are amazing sir

  • @AkshatTambi
    @AkshatTambi 17 годин тому

    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; } };

  • @shwetachoudhary9003
    @shwetachoudhary9003 17 годин тому

    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...❤

  • @user-kn1gt7uv3v
    @user-kn1gt7uv3v 17 годин тому

    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.

  • @sharusharath1058
    @sharusharath1058 17 годин тому

    nice explaination

  • @Wavlength
    @Wavlength 18 годин тому

    Understood

  • @ujjwalbisaria788
    @ujjwalbisaria788 18 годин тому

    us

  • @soumiyamuthuraj3516
    @soumiyamuthuraj3516 18 годин тому

    Awesome

  • @tanmaybisht_iit-bhu2005
    @tanmaybisht_iit-bhu2005 18 годин тому

    Understood

  • @dheerajshukla7008
    @dheerajshukla7008 18 годин тому

    thankyou so much sir