Sir my sample test case is passing but all other are failing will you please check This is my code
#include
#include
#include
using namespace std;
#define ll long long
ll giveLocationOfNumber(vector list,ll num){
for(ll i=0;i<list.size();i++){
if(list[i]==num)
return i;
}
}
int main() {
ll n,k;
vector numbers;
cin>>n;
cin>>k;
for(ll i=0;i<n;i++){
ll x;
cin>>x;
numbers.push_back(x);
}
for(ll i=0;i<n && k;i++){
ll number_at;
ll temp;
if(numbers[i]==n-i){
continue;
}
else{
number_at=giveLocationOfNumber(numbers,n-i);
//swap the number;
temp=numbers[i];
numbers[i]=numbers[number_at];
numbers[number_at]=temp;
k--;
}
}
for(ll i=0;i<n;i++){
cout<<numbers[i];
}
return 0;
}