Please explain question

If # is encountered, then row is considered to be blocked, then how will I proceed, should i go to next row or should i go to previous row and start again?

@ankush.bhardwaj0 hey ankush visit to this you will get to know. how this working

Thank you, seems i over analysed the question.

@jaiskid https://ide.codingblocks.com/s/104623
I have written the code for the program. Testcase 2 showed run error. Why?

@ankush.bhardwaj0 hey ankush see your second loop both are running on n you should start dry run your logic.

@jaiskid please tell me what does a run-error mean? Is it wrong answer or TLE?
Also i changed the loop to j = i ;j<n-1, then 1st and 2nd test case passed but 3rd one got wrong.

@ankush.bhardwaj0 hey ankush
A runtime error is a program error that occurs while the program is running. The term is often used in contrast to other types of program errors, such as syntax errors and compile time errors.

There are many different types of runtime errors. One example is a logic error, which produces the wrong output. For example, a miscalculation in the source code or a spreadsheet program may produce the wrong result when a user enters a formula into a cell. Another type of runtime error is a memory leak. This type of error causes a program to continually use up more RAM while the program is running. A memory leak may be due to an infinite loop, not deallocating unused memory, or other reasons.

A program crash is the most noticeable type of runtime error, since the program unexpectedly quits while running. Crashes can be caused by memory leaks or other programming errors. Common examples include dividing by zero, referencing missing files, calling invalid functions, or not handling certain input correctly.

NOTE: Runtime errors are commonly called referred to as “bugs,” and are often found during the debugging process, before the software is released. When runtime errors are found after a program has been distributed to the public, developers often release patches, or small update designed fix the errors.
and check the code for this case
4 4 5 10
dot star star star
star hash dot dot
star star dot dot
star hash star star
your output is No
but output is
Yes
31

@jaiskid
The testcase that you have given works fine in my previous code:

@jaiskid This same code when submitted passes testcase 1 and 3 but shows run error for 2.
However, once i changed the j in the for loop like j=i;j<n-1 and then 1 and 2 testcase was passed and 3rd one showed wrong. I am totally confused. Please tell me whats wrong with my code.

@ankush.bhardwaj0 hey anukush
try with this test case
4 4 5 10
. . * .
. # . .
star star dot dot
. # * *
do fight with this your code is giving run time
dry run your code why your code is accepting your inputs
this give output as no

@jaiskid thanks, the testcase had passed. The code was correct but the problem happened with the if else statement since i hadnt mention else if for a # specifically …i simply wrote else…

@ankush.bhardwaj0 yeah your else{} was creating problem all we can give you hint.

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.