Number of minimum picks to get 'k' pairs of socks from a drawer - Day 4 of

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

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

  • @m.vineeth9724
    @m.vineeth9724 3 года назад +1

    Awesome explanation, totally loved it. Thanks a lot.

  • @jrhwood_
    @jrhwood_ 4 года назад +1

    Thanks for the walkthrough, I spent ages trying to find an explanation, I now understand the problem. Perhaps just preference. But here is the functional implementation of your approach that avoids explicit for loops.
    ```
    class Solution:
    def maximum_pairs(self, a):
    return sum(map(lambda x: x // 2, a))
    def optimal(self, a):
    return sum(map(lambda x: (x - (2 - x%2)) // 2, a))
    def is_possible(self, k, n):
    return k

    • @SaiprakashReddy
      @SaiprakashReddy  4 года назад +1

      Appreciate the comment Jesse . Happy to know that the walkthrough helped you in understanding the problem . Thanks for the posting your functional implementation . Feel free to post your code , it might help others watching .

  • @aasheesh_sahu
    @aasheesh_sahu 4 года назад

    THANK YOU SO MUCH BRO.

  • @akanksha1400
    @akanksha1400 4 года назад

    you are doing good..keep going :)

  • @ghazanferwahab5673
    @ghazanferwahab5673 3 года назад

    plz give the solution of find the count of special number in an array where a number is divisible by all eelemnts of the array in nlog(max(n)) complexity

  • @yashvisoni5819
    @yashvisoni5819 4 года назад

    thankyou

  • @SaranRavali
    @SaranRavali 4 года назад +1

    how did you come up with this solution ??? can you elaborate more , if possible ... or if you can give us any reference of the maths you said you know ... ll check it... Thank you.

    • @SaiprakashReddy
      @SaiprakashReddy  4 года назад +1

      Hello saran ,
      I have referenced the editorial solution provided by the geeksforgeeks , they have provided the very explanatory comments for the math .

    • @adrikagupta5573
      @adrikagupta5573 4 года назад

      @@SaiprakashReddy Can you please share the link to the site where the maths has been explained? I don't think it's there in the description. Thank you.

  • @TargetCGL9
    @TargetCGL9 4 года назад

    Tq