Can't Understand how to proceed, Vivek Loves Array

please make changes in the code itself , not able to think base conditions , https://ide.codingblocks.com/s/224943

hello @Codemaniac_Aditya
please refer this ->https://www.hackerrank.com/challenges/array-splitting/editorial

what is wrong in this code , https://ide.codingblocks.com/s/224943

@Codemaniac_Aditya
are u getting tle ?

No for every testcase the answer is coming out to be 0

image
here u missed a case when ur l will be 0.
in that return only arr[r];

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.

Getting a run error , and passing a single testcase!
link:https://ide.codingblocks.com/s/224943