About Unlock question

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;

}

please provide code using ide link…

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.