238. Product of Array Except Self | Math | Prefix Product | 4 Approaches

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

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

  • @Hmmm0135
    @Hmmm0135 8 месяцев назад +4

    Great Explanation

  • @jeehub041
    @jeehub041 8 месяцев назад +1

    Bhai ye O(1) extra space me bhi ban jayga just need to take the count lf zeros if zeros are more than 1 no matter what all values will be zero of zeros are 1 for sure that vak can be calculated and if no zeros in the array it's fine as well

  • @paraswaghela8077
    @paraswaghela8077 8 месяцев назад +2

    Count the Zeroes , if more than 1 zeroes are there then entire ans array will be Zero , but if only 1 zero is there then will compute product of entire array by skipping that one zero and during computing ans array we will put zero in all ans[i] and when we encounter zero we will put product in that case ! Maybe this will work!

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

      question tells us that don't use division operator

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

    10:29 "remember the fact" "maksad nhi bhulna"

  • @UECAshutoshKumar
    @UECAshutoshKumar 8 месяцев назад +1

    Thank you 😊

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

    NICE, BROTHER. KEEP POSTING SUCH DAILY CHALLENGES! THANKS.

  • @anshkhetrapal7053
    @anshkhetrapal7053 8 месяцев назад +1

    We can do it by using division operation also. But according to this constraint it is of no value.
    class Solution {
    public:
    vector productExceptSelf(vector& nums) {
    vector vt;
    int p=1,z=1,flag=0,c=0,co=0;
    for(int i=0;i

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

    nice

  • @codecode855
    @codecode855 6 месяцев назад

    how come multiplying 30 , 10^5 times makes 30*10^5 ?? it should be 30^(10^5)

  • @harshroy1198
    @harshroy1198 8 месяцев назад +1

    ladu aram se bolkr

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

    Ye sb band karo do ab...devin kar dega

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

      Devin ko bhi Human ( programer) to Kal kon Tum bhi bana sakte ho