Tapioka
InterviewTime limit2sMemory limit1024 MB
Given a three-word dish name, remove the words "bubble" and "tapioka", then print the remaining words or "nothing" if none remain.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
These days bubble tea is popular around the world. It goes by different names: bubbles, pearls, tapioka. People have started thinking about putting tapioka into almost every food. Bubble tea pizza, bubble tea ramen, bubble tea hotpot, bubble tea cake, and so on.
Given the name of a dish, you will repeatedly remove every tapioka part and reveal the true colors of that dish. In this problem a dish consists of exactly three words. Every dish always starts with either "bubble tea" or "tapioka". For example, you may see a dish named "bubble tea ramen", but you will never see a dish named "bubble ramen tea".
Input
The input file contains exactly one test case. There is only one line in the input file, and it contains a dish name consisting of exactly three words.
Output
If, after repeatedly removing every occurrence of "bubble" or "tapioka" (as an entire word), you find nothing left, output "nothing". Otherwise, output the remaining words separated by blanks in the original order.
Constraints
- In this problem, a word is a string of English letters in lowercase.
- In the input file, all words are separated by blanks.
- The length of each word does not exceed 32.