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
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 .
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
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 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.
Awesome explanation, totally loved it. Thanks a lot.
Glad it helped!
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
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 .
THANK YOU SO MUCH BRO.
you are doing good..keep going :)
Tq ... Definitely .
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
thankyou
Are you from IIT Gandhinagar??
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.
Hello saran ,
I have referenced the editorial solution provided by the geeksforgeeks , they have provided the very explanatory comments for the math .
@@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.
Tq
🙂