Remaining String
Submissions: 13039   Accuracy:

23.33%

  Difficulty: Easy   Marks: 2

Given a string without spaces, a character, and a count, the task is to print the string after the specified character has occurred count number of times.
Print “Empty string” incase of any unsatisfying conditions.
(Given character is not present, or present but less than given count, or given count completes on last index).
If given count is 0, then given character doesn’t matter, just print the whole string.

 

Input:

First line consists of T test cases. First line of every test case consists of String S.Second line of every test case consists of a character.Third line of every test case consists of an integer.


Output:

Single line output, print the remaining string or "Empty string".


Constraints:

1<=T<=200
1<=|String|<=10000


Example:

Input:

2
Thisisdemostring
i    
3‚Äč
geeksforgeeks
e
2

Output:
ng
ksforgeeks

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Sahil Chhabra
Author: Sahil_Chhabra


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.