Is there any other way to printing mirror image of a matrix avoiding TLE?

this is what I could think of so far:

#define ll long long int
#define ull unsigned long long int
int main()
    int n, m, i, j;
    scanf("%d %d", &n, &m);
    ll arr[n][m];
            scanf("%d", &arr[i][j]);
            printf("%d ", arr[i][j]);
    return 0;

here I have to invert the elements of a row. for example if I input: 1 2 3\n 4 5 6\n 7 8 9 then the program should print: 3 2 1\n 6 5 4\n 9 8 7 my program gives proper result but its exceeding the given time limit.

Read more here:

Content Attribution

This content was originally published by Sanzida Hossain at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: