Find the error. Sample Input is giving correct output

hey @dhruvtrehan45 you have to print columns so your i should be iterating in columns and j should be iterating in rows.inside for loop where you using i take it upto cols,and for j take it upto rows or start j from rows-1.sample is giveing right because for sample case rows==cols.hope it helps if still faces any problem let me know else mark this doubt as resolved.Thankyou

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.