Here’s pictorial representation of your code. I have marked the issue you are facing. Please correct it