How do i take input by ignoring space in sample test case 2d matrix?

Here is the link https://ide.codingblocks.com/s/158935

Naman, I have edited your code now, pls try to submit, it was showing runtime error, I have used 2d char array, and also in the code 2 conditions were included, which you havent included, because of which it was showing runtime error…

On line 39 why have u done n=n+1 ? Shouldn’t it be i=i+1 ?

No, because n=n+1, is the condition included for the next row, if you will write i=i+1, the entire code will produce different ans,…

Since you arent replying, I am marking this doubt as resolved… You can reopen it if you face any doubt…