My issue
consider when n=3 ;
why is it that -
1 2 3
3 2 1
is a wrong answer ?
My code
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl '\n'
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
void solve () {
ll n;
cin>>n;
for (ll i=01;i<=n;i++)
cout<<i<<" ";
cout<<endl;
for(ll i=n;i>0;i--)
cout<<i<<" ";
cout<<endl;
}
int main() {
fastio();
int t;
cin >>t;
while(t--) {
solve();
}
}
Problem Link: Maximum Distance Permutations Practice Coding Problem