Count and Say | Made Super Easy | Google | Explanation | Live Coding

Поделиться
HTML-код
  • Опубликовано: 10 ноя 2024

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

  • @csengineer8819
    @csengineer8819 9 дней назад +1

    sir pheli baar hindi dekhi coding ke question ... pura 1-12th ka hindi medium school yaad agya

  • @tilakbhujade4438
    @tilakbhujade4438 9 месяцев назад +4

    Very nice explanation. Pura ka pura logic samajh gaya. Apke logic se code maine khud hi solve kar diya. Thanks Sir!!! (That superbike sound in the BG tho...)

  • @aakarsh987
    @aakarsh987 8 месяцев назад +5

    Damn I saw so many explanations but couldn't understand anyone, you explained in a magical way, it was so amazing, thank you!!

    • @Anikashukla1808
      @Anikashukla1808 2 месяца назад

      whats the time and space complexity?

  • @MounikaEMB
    @MounikaEMB Год назад +2

    Just started strings playlist.😊
    As per question its hard to understand but after your explanation it is easy for me to understand... Thank you for making such a great videos for us🙏

  • @souravjoshi2293
    @souravjoshi2293 2 года назад +3

    Dude this became so easy. Thanks

  • @sp_9467
    @sp_9467 2 месяца назад +3

    Very nice handwriting

  • @vineetjadhav1785
    @vineetjadhav1785 Месяц назад +1

    Very Great Explaination ❤❤👋👋

  • @akshatprakash126
    @akshatprakash126 4 месяца назад +1

    great explanation! hidden gem of a video

  • @_PRANAYMATE
    @_PRANAYMATE 3 месяца назад +1

    Understood and code it on my own thanks bro

  • @ArjunSaxena-wl3qs
    @ArjunSaxena-wl3qs 8 месяцев назад

    Amazing !
    .
    .
    .
    .
    .
    .
    class Solution:
    def countAndSay(self, n: int) -> str:

    if n == 1 :
    return '1'

    def helper(n) :

    if n == 1 :
    return '1'

    say = helper(n - 1)
    # processing
    i,j = 0,1
    res = ''
    count = 1
    while j < len(say) :
    if say[i] == say[j] :
    count += 1

    else:
    res += str(count) + say[i]
    count = 1
    i = j
    j += 1
    res += str(count) + say[i]
    return res
    return helper(n)

  • @knight-z1x
    @knight-z1x 3 месяца назад +1

    bdiya smjha ya apne

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

    Such a fine explanation man. 🙌

  • @_Deepak__Verma
    @_Deepak__Verma 8 месяцев назад

    why length is say.length() instead of i

  • @AjitKumar-jr7jo
    @AjitKumar-jr7jo Год назад +6

    Today i sit in a OA of a company ,and it is the 1st question out of 3 , i could not understand this question, i totally got panicked and won't able to solve a single question.;)

    • @codestorywithMIK
      @codestorywithMIK  Год назад +3

      Thank you for sharing but it’s ok, keep practising and soon you will be able to crack interviews.
      Would you mind sharing which company’s OA was it ?

    • @AjitKumar-jr7jo
      @AjitKumar-jr7jo Год назад

      @@codestorywithMIK it is on-campus company name is zessta.

  • @Rajnish-pu8mj
    @Rajnish-pu8mj 5 месяцев назад

    great teacher

  • @leo71648
    @leo71648 6 месяцев назад +1

    One of the best explanation and as you said explanation on Leetcode is Pathetic, Keep it up

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

    Excellent explanation!

  • @sayantanpoddar5428
    @sayantanpoddar5428 10 месяцев назад +2

    please came up with " Remove Outermost Parentheses" solution

  • @RohitGupta-xf3zp
    @RohitGupta-xf3zp Год назад +2

    nice bhaiya tgra logic build and inituiton

  • @pranavmaiya4386
    @pranavmaiya4386 18 дней назад

    bro but this goes off to exponential complexity (2^n) , if interviewer expects us to optimize it then ?

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

    class Solution:
    def rec(self,n):
    if n==1:
    return "1"
    temp=self.rec(n-1)
    count=1
    ch=temp[0]
    ns=""
    for i in range(1,len(temp)):
    if temp[i]==ch:
    count+=1
    elif ch!=temp[i]:
    ns+=str(count)+ch
    ch=temp[i]
    count=1
    ns+=str(count)+ch
    return ns
    def countAndSay(self, n: int) -> str:
    return self.rec(n)

    Done✅

  • @pranavmaiya4386
    @pranavmaiya4386 18 дней назад

    what about the follow up question ?

  • @ShivamGupta-cx3hy
    @ShivamGupta-cx3hy 2 года назад +1

    Thank you sir 😊

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

    what is the time complexity for this question?

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

    What is the time complexity for this?

  • @jeethora586
    @jeethora586 4 месяца назад

    please explain time ans space complexity

  • @mohdafzal4017
    @mohdafzal4017 7 месяцев назад

    Thanks alot.. feedback- you need to level up your thumbnail game

  • @B_Patidar88
    @B_Patidar88 14 дней назад

    Bhaiya java me solve karvao pls

  • @mgnfy-view
    @mgnfy-view 10 месяцев назад

    I coded the same solution with typescript but got a low score on time and space complexity.

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

    why recursion, why not a for loop?

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

      You can loop this too i guess.
      Recursion seems more easy to me . So i choose Recursion mostly

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

    Paypal asked this question in it's offcampus interview😅😅

  • @allmovies2473
    @allmovies2473 4 месяца назад

    Noise cancellation wala mic use✅Please✅

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

    bhai tera explaination poora dekhne se pehle hi karliya if n ==1:
    return str(1)
    else :
    temp = str(self.countAndSay(n-1))
    prev = temp[0]
    length=1
    ans=""
    for i in range(1,(len(temp))):
    if prev == temp[i] :
    length+=1
    else :
    ans =ans+str(length)
    ans +=prev
    prev = temp[i]
    length =1
    ans +=str(length)
    ans +=prev
    return ans

  • @carefree_ladka
    @carefree_ladka 5 дней назад

    var countAndSay = function (n) {
    if (n === 1) return '1';
    return countAndSay(n - 1)
    .match(/1+|2+|3+/g)
    .reduce((acc, nums) => acc += `${nums.length}${nums[0]}`, '')
    }; much simpler