Can u pls explain how the code given in soln works

I was able to solve the code but I could not understand what was the soln given to us in the editorial. like what is return inc || exc; how does this work and what is return(sum == 0 && included)

Also I was not able to get even how the code given in editorial is working how it returns true and false and why we have passed true to included when introducing inc boolean.

Hey @code_breaker-1001 inc || exc means Logical OR operation if only a single one or both of them are true then it will return true otherwise false.
Similarly sum == 0 && included if both of them are true then only it will return true;
both these lines are same as :
boolean returnvalue = sum== 0 && included;
return returnvalue;

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.