in this video code there are two function in which bool car rakh paaye have paramters passing to bool can place cows which have differnt parameters how is this possible and how the code is working
In this video code there are two function in which bool car rakh paaye have paramters passing to bool can place cows which have differnt parameters how is this possible and how the code is working
both have differnt parameteer
hi @Aditya-Kushwaha-914550392281281, there is only one function named as canPlaceCows .
what happens is we have decided the range in which our ans lies i.e [s,e] and we will compute mid value which is (s+e)/2 and then we call function canPlaceCows(stalls,n,cows,mid) ,Now this function checks if it is possible to have minimum seperation between the cows as mid if yes then this function returns true else returns false , the return value is stored in the variable cowsRakhPaye , so if cowsRakhPaye is true then we will check for larger values else we will check for smaller values (binary search algo)
in case of any doubt feel free to ask 
If you got the answer then mark your answer as resolved
at time stamp 18.50 how we are getting the value of min_sep
min_sep is the value of mid passed to the function as i have mentioned previosly " this function checks if it is possible to have minimum seperation between the cows as mid if yes then this function returns true else returns false , the return value is stored in the variable cowsRakhPaye "
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.