Lexicographical Smallest String

There is a string $s$ of length $n$ containing lowercase letters and an integer $k$. Among the lette…

Click here to read the complete problem statement.

If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

I get error in 11 th case.May one can know the test case after submission like CF?
my code: TZBlo7 - Online C++0x Compiler & Debugging Tool - Ideone.com

Try this test case:
13 7