Submit | All submissions | Best solutions | Back to list |
SHAKILKEYWORD - Keyword Finder |
Nahid bhai is a principal software engineer of a renowned software company. Rumman is an associate software engineer of that company. One day Nahid bhai assigned a task to Rumman. The task is to find all keywords from a given string. A keyword is a word that contains at least one “#”. A word may contain other letters and punctuations. Given string will be split based on some delimiters. Rumman is so busy learning cutting edge technology for developing a project. So he assigned this task to you. You as a programmer will do the same thing.
For example: Given string is “Here are some fruit name: #apple, #banana, #orange.”. Delimiters are “|$ *@.&\"!^,?”. So, the words containing “#” will be: “#apple”, “#banana”, “#orange”.
Delimiters are, fixed for all string: “|$ *@.&\"!^,?”.
Input
Input starts with the number of test cases, T (1 <= T <= 10).
Each line contains a string consisting letters and punctuations. (1 <= |string| <= 100).
Output
For each test case, print the keywords in a new line. If no keywords found, then print “No keywords.”
Example
Input: 3 ab#c def#. Abcde fghijabc.efg#ijk #lMn. Output: ab#c def# No keywords. efg#ijk #lMn
Added by: | Nabil |
Date: | 2018-09-26 |
Time limit: | 2s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
2022-01-24 21:04:28 David
Input string length is at least 109. |
|
2019-01-07 21:18:57
use \\ while comparing with \ costed me 2 WA's. |
|
2018-10-01 20:59:35
print the word which has atleast one '#" in it. |
|
2018-10-01 20:50:13
if there are more than one # in keyword then what will be the output. |