1497. Check If Array Pairs Are Divisible by k | maths | hash | Leetcode Daily Challenge | DSA | Java

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 20

  • @shashwat_tiwari_st
    @shashwat_tiwari_st  2 місяці тому +7

    Like target for this video 130. Please do like if you were able to understand this question!😄😄

    • @samratsamrat8477
      @samratsamrat8477 2 місяці тому

      Sorry but I am understand please explain code properly 😔

  • @PiyushSharma-we8yd
    @PiyushSharma-we8yd 2 місяці тому +3

    ❤❤❤

  • @Nitinkumarsharma-q2x
    @Nitinkumarsharma-q2x 2 місяці тому +3

    first person to watch 100%

  • @MANISHPANDEY-dt8cd
    @MANISHPANDEY-dt8cd 2 місяці тому

    For negative numbers, we often convert them to their equivalent positive number. For instance, take -1 and a positive integer k. When we compute (-1 % k), the result is -1. Adding k to this result gives (k - 1), which is a valid positive remainder. Thus, we don’t need to perform another %k operation because (k - 1) is already within the range of 0 to (k - 1), which are the possible remainders when dividing by k.
    so why are we doing extra %k ((-1 %k)+k) %K what is the need of the %K which is outside the brakets.

  • @amit4006
    @amit4006 2 місяці тому

    What a wonderful explanation bhaiya

  • @dhananjaybamhande1604
    @dhananjaybamhande1604 2 місяці тому +3

    Shashwat sir you are my god and you look like my Big brother so i am understand easily.

  • @SandeepYadav-zi9qt
    @SandeepYadav-zi9qt 2 місяці тому

    sir could you give us references of " complementry remainder for integer" that you have used in line no. 5 😍😍...

  • @kunwaryadav9586
    @kunwaryadav9586 2 місяці тому

    Sir, please tell me a approx time in which your DSA playlist will complete, so I can make my plan for future, please reply sir 🙏🏻🙏🏻🙏🏻

  • @PhilosophyOfGreatests
    @PhilosophyOfGreatests 2 місяці тому

  • @shubhamdukare8310
    @shubhamdukare8310 2 місяці тому +1

    sir which pentab you use for notes?

  • @raunakgupta5528
    @raunakgupta5528 2 місяці тому +1

    Sir, why u haven't taken (1,4) that is also divisible by 5 right

  • @Aniedits24
    @Aniedits24 2 місяці тому

    How you come with the logic of remainder and creation of the array?

  • @B-Billy
    @B-Billy 2 місяці тому

    Thanks for your video.
    However, I just dont understant why are not we doing '( num1+nums2)/k == 0'. This will aslo produce the same result. Can you explain this.
    Why do we even need to check num1 reminder and num2 reminder and then check their sum.

    • @PhilosophyOfGreatests
      @PhilosophyOfGreatests 2 місяці тому

      You won't be able to check for the negative numbers with this approach

  • @nish0798
    @nish0798 2 місяці тому

    bhai ek baat btao yaar question dekh ke pata kaise chalega ki ye concept use hoga mai. main ti nai soch paya ki aisa bhi kuch ho sakta hai
    maine toh basic 2 pointer Socha tha
    class Solution {
    public boolean canArrange(int[] arr, int k) {
    Arrays.sort(arr);
    int half=arr.length/2;
    int i=0;
    int j=arr.length-1;
    int c=0;
    while(ik)
    {
    j--;
    }else{
    i++;
    }
    }
    if(c==half)
    {
    return true;
    }
    return false;
    }
    }
    maine around 350 questions solve kar liye hai fir bhi new problem me dikkat aait hai please reply