Have you heard of YANDEX? | Fixed Size Sliding Window Problem - Permutation in String - Leetcode 567

Sdílet
Vložit
  • čas přidán 2. 01. 2024
  • dynamic programming, leetcode, coding interview question, data structures, data structures and algorithms, faang

Komentáře • 37

  • @GregHogg
    @GregHogg  Před 6 měsíci

    Master Data Structures & Algorithms For FREE at AlgoMap.io!

  • @sanjeevsinghrajput5593
    @sanjeevsinghrajput5593 Před 6 měsíci +34

    Yandex have a pretty good reverse image search

    • @dimitarivanov7249
      @dimitarivanov7249 Před 6 měsíci +2

      Also pretty good spyware

    • @gabrieldantas63
      @gabrieldantas63 Před 6 měsíci

      ​@@dimitarivanov7249 "everything that comes from Russia is spyware" - some you would expect to read on leddit, not in a programming video.

    • @mujtabarehman5255
      @mujtabarehman5255 Před 6 měsíci +2

      @@dimitarivanov7249Nice conspiracy theory

    • @dimitarivanov7249
      @dimitarivanov7249 Před 6 měsíci

      @mujtabarehman5255 it's true though, yandex is the Russian Google and if your run ads on their platform and you also have a physical ad for example a billboard, with yandex you can target people who saw your billboard.
      That's because yandex tracks exact GPS location and knows the angle at which people crossed your billboard.
      Also if you use yandex metrica, which is the equivalent of Google analytics, you can see exactly where people clicked or scrolled on your website

    • @sanjeevsinghrajput5593
      @sanjeevsinghrajput5593 Před 6 měsíci

      @@dimitarivanov7249 Yandex devs spying my 25th Kamen Rider reverse image search this week

  • @timuchin1994
    @timuchin1994 Před 6 měsíci +12

    It is a russian company. Basically, russian Google

  • @MichaelOnayan
    @MichaelOnayan Před 6 měsíci

    love your content it's fantastic and full of valuable lessons

  • @juanvalcecchi3464
    @juanvalcecchi3464 Před 6 měsíci

    Damn! Thanks man great content

  • @dial-upking
    @dial-upking Před 4 měsíci

    Only difference I had was using a map instead of just a basic array for the frequency graphs. If I had to guess, the array is probably better in both compute time and memory compared to a map with it's overhead, but it only works assuming the strings only contain the 26 English lowercase alphabet characters. Here would be my Java submission:
    private static final BiFunction ADD = (a, b) -> {
    int s = a + b;
    return s == 0 ? null : s;
    };
    private static boolean perm(String s1, String s2) {
    HashMap f1 = new HashMap(), f2 = new HashMap();
    for (char c : s1.toCharArray()) {
    f1.merge(c, 1, ADD);
    }
    char[] s2a = s2.toCharArray();
    int l1 = s1.length(), l2 = s2a.length, n = l1;
    for (byte i = 0; i < l1; ++i) {
    f2.merge(s2a[i], 1, ADD);
    }
    do {
    if (f1.equals(f2)) {
    return true;
    }
    f2.merge(s2a[n - l1], -1, ADD);
    f2.merge(s2a[n], 1, ADD);
    } while (++n < l2);
    return false;
    }

  • @ghost_online6926
    @ghost_online6926 Před 6 měsíci

    He is so close to becoming an alien

  • @Daimakaicho
    @Daimakaicho Před 6 měsíci

    and nobody said it cannot contain capital letters, numbers, chars in that string not forgetting some countriers wierd characters basically unicode ...

  • @michaelmatveev6630
    @michaelmatveev6630 Před 4 měsíci

    lol have you heard of Yandex? ?? That’s gold.
    I’ll say that no one should know them

  • @memememes-qo2ds
    @memememes-qo2ds Před 4 měsíci

    how do u find these questions?

  • @SKOBRY
    @SKOBRY Před 6 měsíci +1

    Isn’t "d", "c" and "" also permutations of "dc"?

    • @GregHogg
      @GregHogg  Před 6 měsíci

      Might be confusing with subsets or substrings

  • @ivanmorales7786
    @ivanmorales7786 Před 6 měsíci +1

    "...well neither have I" xD!

  • @rejul008
    @rejul008 Před 5 měsíci

    t & s interchanged in code

  • @dohunkim2922
    @dohunkim2922 Před 6 měsíci

    how efficient is it to use list instead of hashmap in this case? ive heard that using map is better when it comes to alphabets but I dont get why

    • @EMdragonKnight
      @EMdragonKnight Před 5 měsíci

      Well it's the instant lookup for the value. To search any value is O(1). If you search a list your worst time search could be O(N). Also code wise it's going to be a little more messy to update the list cause you're going to need a list of list and access the 2nd index.
      I think due to the fact there's only 26 letters in the alphabet that a list of list isn't a bad approach since your N is just 26.

  • @micah9421
    @micah9421 Před 6 měsíci +3

    Can't u just do something like this:
    1. If s1 is longer then s2 return false
    2. For each char x in s1
    -> if s2 contains x
    -> -> remove x from s2
    -> else return false
    Return true

    • @micah9421
      @micah9421 Před 6 měsíci

      I guess mine is O(n^2) where urs is closer to O(n) (in time complexity)

  • @davidazizov8864
    @davidazizov8864 Před 4 měsíci

    Yandex is like Google but in Russia

  • @aciddev_
    @aciddev_ Před 6 měsíci

    yes i am. i live in Russia.

    • @GregHogg
      @GregHogg  Před 6 měsíci

      Haha yep, then you certainly would!

  • @rjarrjay1757
    @rjarrjay1757 Před 5 měsíci

    I just had this question and failed

  • @OggVorbis69
    @OggVorbis69 Před 6 měsíci +6

    Lol everyone knows Yandex

  • @wwloyd
    @wwloyd Před 5 měsíci

    are you living in cave?

  • @tharalpius778
    @tharalpius778 Před 3 měsíci

    Yandex the rusian Google

    • @GregHogg
      @GregHogg  Před 3 měsíci

      Yep hahaha

    • @tharalpius778
      @tharalpius778 Před 3 měsíci

      @@GregHogg hey the one where you check out the island in a matrix count the number of transitions from 0 to 1 row wise and column wise then multiply by 2

    • @trueemperor3647
      @trueemperor3647 Před 2 měsíci

      How to get dark theme of leet code