My code not running can you please check
@aryaman.kumar26, these are some errors in your code :-
- return 0; should be outside the for loop
- it should be cout<<ans<<endl; (print answer per line for every test case)
- you should’nt initialize your ans with INT8_MAX as its value is 127 and your answer can be greater than that
- in your is_allocation function inside for loop you should check if(arr[i]>mid){return false;}
corrected code :-
In case of any doubt feel free to ask 
mark your doubt as RESOLVED if no further querries
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.