A Game of Strings Pandit is playing a game of strings. As it is well known that he isn’t very bright. So he needs your help in winning this game. The game is very simple. You are given a string S of l

Get perfect grades by consistently using www.essayjunction.com. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

A Game of Strings

Pandit is playing a game of strings. As it is well known that he isn’t very bright. So he needs your help in winning this game.

The game is very simple. You are given a string S of length N and an integer K. You have to print first K occurences(if for any character count < K then print them all) of every character in the given order.

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

INPUT FORMAT

First line contains T, number of testcases.

1≤T≤100

First line of each testcase contains 2 integers N and K.

1≤N≤10^5

1≤K≤10^4

Second line contains the string S, comprising of only lowercase alphabets.

OUTPUT FORMAT

Print the required string.

SAMPLE INPUT

1

10 3

abcaacbccb

SAMPLE OUTPUT

abcaacbcb

Write a java program for this….///

Writerbay.net

We offer the best essay writing services to students who value great quality at a fair price. Let us exceed your expectations if you need help with this or a different assignment. Get your paper completed by a writing expert today. Nice to meet you! Want 15% OFF your first order? Use Promo Code: FIRST15. Place your order in a few easy steps. It will take you less than 5 minutes. Click one of the buttons below.


Order a Similar Paper Order a Different Paper