This is giving wright output but why isn't hackerblocks tests-cases not passing?

#include
using namespace std;

void rotate_image(int image[100][100], int n){

int newarr[100][100];



for (int i = 0; i < n; ++i)
{
	for (int j = 0; j < n; ++j)
	{
		newarr[i][j] = image[j][3-i];
		cout<<newarr[i][j]<<" ";
	}

	cout<<endl;
}

}

int main(){

int n;

cin>>n;

int image[100][100];

//take input
for (int i = 0; i < n; ++i)
{
	for (int j = 0; j < n; ++j)
	{
		 cin>>image[i][j];
	}
}

rotate_image(image, n);

return 0;

}

Hello @pranjalsoni,

Share your code using Online Coding Blocks IDE.
The way you have shared it may introduce many syntax errors to it.
STEPS:

  1. Paste it at https://ide.codingblocks.com/
  2. Save it there.
  3. Share the URL generated.

Hello @S18ML0016,

There are two issues with your code:

  1. You n=have not accounted for the constraint given in the question:
    N < 1000
    Problem:
    int image[100][100];

  2. The logic you have applied is specific to n=4

I have corrected your code:

Give a like if you are satisfied.

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.