Super Easy FAANG Interview Question! Is Subsequence - Leetcode 392

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • dynamic programming, leetcode, coding interview question, data structures, data structures and algorithms, faang

ความคิดเห็น • 24

  • @GregHogg
    @GregHogg  หลายเดือนก่อน

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

  • @polyjackets8659
    @polyjackets8659 7 หลายเดือนก่อน +38

    its statistically easier to get accepted to Harvard than to get hired by google

    • @priyanshuganatra
      @priyanshuganatra 7 หลายเดือนก่อน +5

      Lol it's depressing how tough it's to get a tech job in a good company nowadays

    • @erek
      @erek 7 หลายเดือนก่อน +6

      number of tech companies better than google is greater than the number of ivy leagues

    • @anti-tankartur677
      @anti-tankartur677 7 หลายเดือนก่อน

      Google?? Try any tech jobs rn

    • @meloviiii
      @meloviiii 6 หลายเดือนก่อน

      Yeah tbf the number of great companies are countless, compared to number of ivy leagues​@@erek

  • @dawsonwmnm
    @dawsonwmnm 7 หลายเดือนก่อน +4

    BRO IS ON TO NOTHING🔥🗣

  • @mrchrunchasmr
    @mrchrunchasmr 7 หลายเดือนก่อน +1

    always come across your videos but never subscribed but it was consistently too good to not subscribe so you erned a subscriber keep doing amazing bro im a content creator myself and i can see the effort you put into these videos

  • @SajjadAhmed-lc2dr
    @SajjadAhmed-lc2dr 7 หลายเดือนก่อน +1

    best series

  • @codingparas
    @codingparas 7 หลายเดือนก่อน

    Great videos.

  • @mrchrunchasmr
    @mrchrunchasmr 7 หลายเดือนก่อน

    amazing vids

  • @target500milliontradersinv5
    @target500milliontradersinv5 7 หลายเดือนก่อน

    Bro, Pls update these problems in google sheet, so it would great and helpful

  • @tomaszeq75
    @tomaszeq75 7 หลายเดือนก่อน +1

    recursion version
    t = 'abcde'
    s = 'acd'
    def is_subsequence_rec(s: str, t: str) -> bool:
    if s[0] in t:
    if len(s) == 1: return True
    return is_subsequence_rec(s[1:], t[t.index(s[0]) + 1:])
    else: return False
    print(is_subsequence_rec(s, t))

    • @davidespinosa1910
      @davidespinosa1910 7 หลายเดือนก่อน

      In Python, two problems:
      (1) The recursion limit is 1000.
      (2) s[1:] isn't pointer arithmetic -- it actually copies s.

  • @nabilfannane7217
    @nabilfannane7217 7 หลายเดือนก่อน

    Javascript
    let s='abc'
    let t='ahgbc'
    let final=''
    for (let i=0;ival===s[i] ? final+=val:null)
    }
    console.log(final=== s)

  • @Akisame-LuigI-O
    @Akisame-LuigI-O 7 หลายเดือนก่อน

    if you're using python wouldn't it be faster to use regex or is that not allowed here?

    • @davidespinosa1910
      @davidespinosa1910 7 หลายเดือนก่อน

      Generally not allowed. But good idea, how would you write it using a regex ?

    • @Akisame-LuigI-O
      @Akisame-LuigI-O 6 หลายเดือนก่อน

      @@davidespinosa1910 ".*".join(s). That's your regex prompt

  • @AbhishekSharma-ex7rx
    @AbhishekSharma-ex7rx 7 หลายเดือนก่อน +2

    Why are you mostly explaining most asked easy question just to pull out most of the audience you should explain medium questions BCS it is the truth that they are asked more then easy ones.

  • @eshvarbalaji3950
    @eshvarbalaji3950 7 หลายเดือนก่อน

    Say is it 1) A B C
    2)BAC then will A get missed out?

    • @robertomachin8914
      @robertomachin8914 5 หลายเดือนก่อน

      Agreed, but I guess you cam just sort them beforehand to make sure its in alphabetical order

  • @basharal-ghada3242
    @basharal-ghada3242 7 หลายเดือนก่อน +2

    I think your logic is a bit flawed, what if there are 2 A's , like aghabjkabc
    This won't work

    • @codingparas
      @codingparas 7 หลายเดือนก่อน +5

      It works. It's a subsequence not a substring.

    • @basharal-ghada3242
      @basharal-ghada3242 7 หลายเดือนก่อน +1

      @@codingparas thanks for clarifying, my bad 😅