Chocolate Distribution | GFG Solution | Searching and Sorting

Sdílet
Vložit
  • čas přidán 2. 06. 2021
  • Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
    NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. Question Statement:
    1. Given an array A[] of positive integers of size N, where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are M students, the task is to distribute chocolate packets among M students such that :
    2. Each student gets exactly one packet.
    3. The difference between maximum number of chocolates given to a student and minimum number of chocolates given to a student is minimum.
    Topic: #Array #GFG #SearchingAndSorting
    Used #DataStructure: #Array
    #TimeComplexity: O(nlogn)
    #SpaceComplexity: O(1)
    For detailed information and other exercises, VISIT: www.pepcoding.com
    Have a look at our result: www.pepcoding.com/placements​
    Follow us on our FB page: / pepcoding​
    Follow us on Instagram: / pepcoding​
    Follow us on LinkedIn: / pepcoding-education
    ----------------------------------------------------------------
    #Array #geeksforgeeks #SearchingAndSorting
    For a better experience and more exercises, VISIT: www.pepcoding.com/resources/
    Have a look at our result: www.pepcoding.com/placements
    Follow us on our CZcams page: / pepcoding
    Follow us on our FB page: / pepcoding
    Follow us on Instagram: / pepcoding
    Follow us on LinkedIn: / pepcoding-education
    Follow us on Pinterest: / _created
    Follow us on Twitter: home
    .
    .
    .
    Happy Programming !!! Pep it up 😍🤩
    .
    .
    .
    #pepcoding #code #coder #codinglife #programming #coding #java #freeresources #datastrucutres #pepcode #competitive #competitiveprogramming #softwareengineer #engineering #engineer

Komentáře • 40

  • @shivamroy6399
    @shivamroy6399 Před rokem +2

    pepcoding is the best platform to learn DSA. thanks to entire team of pepcoding

  • @yashrtajane4680
    @yashrtajane4680 Před 2 lety +8

    Great explanation ! Totally loved the way you elaborated all the things 💥💯

  • @arealist8913
    @arealist8913 Před 2 lety +3

    Oh my goodness! Ye itna asaan tha kya?!
    Totally loved your explanation. Pepcoding rocks!

  • @SaumyaSharma007
    @SaumyaSharma007 Před rokem +1

    omg, what an intuition.
    thanks a lot, pepcoding. Thanks Di

  • @ronakhariya8404
    @ronakhariya8404 Před 2 lety +3

    wow!! On-point explanation. Really explained it very well mam.

  • @SunnyKumar-md8fq
    @SunnyKumar-md8fq Před 3 lety +3

    thank you so much mam and pepcoding team of sumit sir main 1 baar ke pura crystal clear ho gya..bhut simple idea se apne clear kr diye..mtlb kya bole bilkul shock ho gya ittna easily ho gyA...ashe video bnate rhye mam..aplog ke he bharose ha humlog thank you

    • @tubakhalid5222
      @tubakhalid5222 Před 3 lety +1

      So true !

    • @Pepcoding
      @Pepcoding  Před 3 lety +2

      Thankyou
      I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
      If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @kunalkheeva
    @kunalkheeva Před rokem +1

    Best explanation!!

  • @alim241081
    @alim241081 Před rokem +1

    very good way of teaching.kash BE karte waqt ye sab dekhte

  • @motivationandgyan2.0
    @motivationandgyan2.0 Před 3 lety +2

    explaining with patience. awesome

  • @tubakhalid5222
    @tubakhalid5222 Před 3 lety

    So precisely explained!!!!

  • @rosonerri-faithful
    @rosonerri-faithful Před 2 lety +2

    Manisha Mam explanatory skills are beyond words!😁😃

    • @Pepcoding
      @Pepcoding  Před 2 lety

      Glad you liked it!
      For better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @asktostranger8296
    @asktostranger8296 Před 2 lety +1

    Gajab 😍🙏

  • @anuragyadav8779
    @anuragyadav8779 Před rokem +1

    Great !!

  • @khushibhatia4678
    @khushibhatia4678 Před rokem +1

    Perfect !

  • @tishaagarwal9435
    @tishaagarwal9435 Před 2 lety +2

    Great expalnation..........loved how u explained the problem

    • @Pepcoding
      @Pepcoding  Před 2 lety

      Glad it was helpful!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @anuprandive5145
    @anuprandive5145 Před rokem +1

    thik hai ji thankyou

  • @abhishekkumar-vd9lv
    @abhishekkumar-vd9lv Před rokem +1

    nice explanation

  • @utkarshagarwal587
    @utkarshagarwal587 Před 2 lety +5

    Sorting + sliding window problem

  • @sukritiguin5637
    @sukritiguin5637 Před 2 lety +1

    great explanation!!!!!!!!!!!!

  • @mukulkumar5133
    @mukulkumar5133 Před měsícem +1

    thanks mam

  • @RishavRaj-kn8nm
    @RishavRaj-kn8nm Před 2 lety +1

    thanks ma'am.very nice explaination

  • @gamechanger32
    @gamechanger32 Před 2 lety +1

    Thanks ma'am

  • @mohitdangi6757
    @mohitdangi6757 Před 2 lety

    Thik h ji🙏

  • @ManishYadav-es3gz
    @ManishYadav-es3gz Před 2 lety +1

    I have watched most of your videos because I understand each an every line of code that you write but I can't find videos on some mathematical problems questions ....
    Please do that vas well ,

  • @umangbehl8152
    @umangbehl8152 Před 2 lety +2

    very nice explanation

    • @Pepcoding
      @Pepcoding  Před 2 lety

      Glad you love the explanation, for better experience and well organised content sign up on nados.io and start learning.

  • @amanahmed6057
    @amanahmed6057 Před 3 lety +1

    1 number mam !!!!!!!

    • @Pepcoding
      @Pepcoding  Před 3 lety

      Thank you so much and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @kp_nagar
    @kp_nagar Před 3 lety

    well explained

    • @Pepcoding
      @Pepcoding  Před 3 lety +1

      Thank you so much and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @sumitrawat6493
    @sumitrawat6493 Před 3 lety +2

    mam python ke liye bhi code likh dia kare

  • @Abhaysingh-qw3ok
    @Abhaysingh-qw3ok Před 2 lety

    in for loop there is n-m+1

  • @AngelosAr
    @AngelosAr Před rokem

    What language is this??

  • @ALLIN-dc5my
    @ALLIN-dc5my Před 2 lety

    i dont understand n-m loop thing

    • @Zero-deaths
      @Zero-deaths Před rokem

      it should not be n-m, gfg has a different solution n-m+1

  • @shreeramkushwaha5683
    @shreeramkushwaha5683 Před rokem

    what is the mistake in my codde can anyone help me
    class Solution
    {
    public long findMinDiff (ArrayList a, int n, int m)
    {
    // your code here
    int ans =Integer.MAX_VALUE;
    Collections.sort(a);
    for(int i=0;i