Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long;
int main()
{
int t;
cin>>t;
while(t--)
{
int N,k;
cin>>N>>k;
if(N==0)
{
cout<<" "<<"\n";
}
else
{
string s;
cin>>s;
sort(s.begin(),s.end());
reverse(s.begin(),s.end());
if(N-k==0)
{
cout<<0<<"\n";
}
else
{
for(int i=0; i<N-k; i++)
{
cout<<s[i];
}
}
cout<<"\n";
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1006 Remove K Digits
- Contest
- Sylhet ICPC 2024 Collaborative Challenge: Episode 2
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-10-30 10:34:06
- Judged At
- 2024-10-30 10:34:06
- Judged By
- Score
- 0
- Total Time
- 2ms
- Peak Memory
- 532.0 KiB