Find All Anagrams in a String-(Amazon, Microsoft, Flipkart):Explanation ➕ Live Coding 🧑🏻‍💻👩🏻‍💻

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • This is the 2nd video on Sliding Window Playlist .
    We will be going through the Sliding Window in the easiest way possible and will make it one of the easiest topics.
    Today, we will do our very first Qn 'Find All Anagrams in a String'
    Problem Name : Find All Anagrams in a String
    Leetcode Link : leetcode.com/p...
    GfG Link : practice.geeks...
    My solutions on Github : github.com/MAZ...
    Company Tags 😱🤯 : Amazon, Intuit, Microsoft, Flipkart
    My GitHub Repo for interview preparation : github.com/MAZ...
    Subscribe to my channel : / @codestorywithmik
    ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
    ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
    ╠╗║╚╝║║╠╗║╚╣║║║║║═╣
    ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
    #coding #helpajobseeker #easyrecipes
    #interviewpreparation #interview_ds_algo #hinglish

Комментарии • 14

  • @sauravfarkade7032
    @sauravfarkade7032 3 месяца назад +4

    Most Underrated channel ever !!!

  • @souravjoshi2293
    @souravjoshi2293 Год назад +1

    binge watching man.
    You are awesome

  • @pradipthij3552
    @pradipthij3552 3 месяца назад

    amazing explanation bhaiya thank you

  • @sakshiarora2853
    @sakshiarora2853 Год назад +1

    you gave the best explanation man.
    reach++

  • @divyanshsagar
    @divyanshsagar Год назад +1

    Awesome explanation!

  • @girikgarg8
    @girikgarg8 11 месяцев назад

    Nice explanation

  • @ankitshaw_3060
    @ankitshaw_3060 Год назад

    Same sliding window approach using unordered_map:-
    class Solution {
    public:
    vector findAnagrams(string s, string p) {
    unordered_map mp;
    for(int i=0;i

  • @ayusharyan2165
    @ayusharyan2165 9 месяцев назад

    Hi Bhaiya, bhot hi clear solution tha kya ek video manacher's algorithm pe bnaoge kya. YT pe tutorials pade h but aapse achha koi ni smjha skta so please wo ek request thi

  • @ankitshaw_3060
    @ankitshaw_3060 Год назад

    Java Code:-
    class Solution {
    boolean allzero(int[] counter){
    for(int i=0;i

  • @sparshyadav9709
    @sparshyadav9709 5 месяцев назад

    Understood.

  • @jagadeeshp1163
    @jagadeeshp1163 10 месяцев назад

    def check(self,counter):
    for i in counter:
    if i!=0:
    return 0
    return 1
    def findAnagrams(self, s: str, p: str) -> List[int]:
    k=len(p)
    ans=[]
    counter=[0 for i in range(26)]
    for i in p:
    counter[ord(i)-ord('a')]+=1
    i=0
    for j in range(len(s)):
    counter[ord(s[j])-ord('a')]-=1
    while(j-i+1==k):
    if self.check(counter):
    ans.append(i)
    counter[ord(s[i])-ord('a')]+=1
    i+=1
    return ans