Majority Element | Leetcode 169 |Moore's voting algorithm | Top 150 interview question series

แชร์
ฝัง

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

  • @sriramongrind
    @sriramongrind 10 หลายเดือนก่อน +2

    Sister the way you explaining blows my mind don't stop teaching you are so good !

  • @manishjeena6325
    @manishjeena6325 ปีที่แล้ว +2

    I appreciate your way of explaining.....thank you❤🙏

  • @adolfocarrillo248
    @adolfocarrillo248 6 หลายเดือนก่อน +5

    But the algorithm is limited to work only if two different elements appears on the array, for more than 2 different elements it won't work. It's kind of restricted functionality.

    • @sppatro9477
      @sppatro9477 6 หลายเดือนก่อน +1

      Yes so then what's the solution?

    • @sppatro9477
      @sppatro9477 6 หลายเดือนก่อน +1

      If you know then please reply

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

    Thank you so much mam, for such simple and accurate explaination.

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

    A big shout out to you Mam. You made topics clear, simple and explanations were on point. A big thank you for all your efforts. If time permits, I humbly request you to please continue the 150 interview leetcode problems.

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

      Hey..i will continue the series very soon..stay tuned

  • @AnjaliYadav-qv4sb
    @AnjaliYadav-qv4sb หลายเดือนก่อน

    it is very useful...thank you

  • @nazim4525
    @nazim4525 ปีที่แล้ว +1

    Awesome 👍👍👍👍 mam

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

    [6,5,5] on that test case answer will be would could you tell me why ??

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

    Hi
    I'm really grateful for this highly self explanatory piece,
    one point that I am in need of clarification: the input is supposed to be 'non-zero', , is that correct please ?

  • @AbhayKumar-xp3dy
    @AbhayKumar-xp3dy 5 หลายเดือนก่อน

    Hey these videos are really helping me .... can you please complete these 150 sheets playlist , turn out to best resource for me till now. please🙂🙂

  • @Harshal-dk2kr
    @Harshal-dk2kr 4 หลายเดือนก่อน +1

    will there will be only 2 types of elements in the array ... suppose [1,1,2,3,0,1] here it is 4 diffetnet element ...so what will be output for it.. and 2 or 3 will not try to decrese their point instead of against 1 ..

    • @manirajsivasubbu
      @manirajsivasubbu 13 วันที่ผ่านมา

      Hi Harshal, understand the question properly. Input array always have the majority element which means count a element should be more the n/2. In your example [1,1,2,3,0,1], I don't see any majority element. To 1 be the majority element, four 1s should be in the input array. Hope this helps you! Happy learning!

    • @Harshal-dk2kr
      @Harshal-dk2kr 13 วันที่ผ่านมา

      @@manirajsivasubbu i got it bro when i wnet to imolement it

    • @Harshal-dk2kr
      @Harshal-dk2kr 13 วันที่ผ่านมา

      @@manirajsivasubbu but ty

  • @Bagulaff
    @Bagulaff ปีที่แล้ว

    Sir muje VMware me job Leni hai to uske liye kya kya karna padega

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

    please continue this series

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

    best

  • @purushothamanr.bemechanica3288
    @purushothamanr.bemechanica3288 ปีที่แล้ว

    good

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

    you dint verified the case that majority element should be more the n/2 ????

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

    Mam please upload the Leetcode question no 238 Product of Array Except Self

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

    This is only works for these two examples. If the the elements of the array getting longer it won't work.

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

    The solution does not work for different arrays.

  • @nazim4525
    @nazim4525 ปีที่แล้ว +1

    Please mam you continue solve LEETCODE questions

    • @TechnosageLearning
      @TechnosageLearning  ปีที่แล้ว +2

      Hi..Will upload videos very soon..

    • @nazim4525
      @nazim4525 ปีที่แล้ว +1

      @@TechnosageLearning One day your youtube channel will increase a lot of subscribers

    • @TechnosageLearning
      @TechnosageLearning  ปีที่แล้ว +1

      Thank you🙏

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

    Mam,given example me '3' ka count 1 ayya h lekin apne ko more than '1'(n/2) chaiye tha , apne ko pta h ki '3' total 2 times h lekin question m kese pta chla ki 3 more than 1(n/2) times h , kioki last m to count '1' hi bachha tha, mtlb usne compare kese kiya length se?

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

    Mam why there are only three types of numbers.?? In array 😢

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

      That is only an example..you can take any type of numbers

  • @GauravRaj-bi9kg
    @GauravRaj-bi9kg หลายเดือนก่อน

    why u have stop the series you may complete it all plzzzzzzzzzz

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

      Hi
      Starting very soon..working on it..Please stay tuned

    • @GauravRaj-bi9kg
      @GauravRaj-bi9kg หลายเดือนก่อน

      @@TechnosageLearning as soon as possible am waiting

  • @soumyabrajwasi845
    @soumyabrajwasi845 ปีที่แล้ว

    it fails when arr is - 3,3,4

    • @TechnosageLearning
      @TechnosageLearning  ปีที่แล้ว +1

      No its not failing ..in this case,majority element is 3 and output is also 3..you can try the code from git repo..You might be missing something

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

    I'm a beginner. After what topics should i learn time and space complexity maam,
    also i wrote this code and got the answer:
    class Solution {
    public int majorityElement(int[] nums) {
    int n = nums.length;

    for(int i=0;i