The last part where the subarray has been printed

pls explain where the sub array has been printed after the max sum ,
why have you considered the value of i and j as -1, and how has that been done

The leftmost and rightmost starting point has just been initialized with -1.You can initilialize it with any invalid index and this will be changed as soon as you get a subarray. It is quite simple, just watch the video again and dry run the code with an example and you will understand it clearly.

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.