Not able to understand the error
@bholu3598
The error is occuring since you are trying to access an invalid memory location. Add this condition to your while loop
j < m-1
or it will try to access invalid locations.
This will resolve the error but even still your algo is incorrect. You need to make changes to that as well.
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.