All submissions for this problem are available.Frieza wants to become immortal. In order to do that he must acquire all the seven dragon balls. In a legendary fight, he is able to defeat Kami, the Guardian of the dragon balls. Now he has come across a case that contains the dragon balls and he needs your help to open it. The case requires a pin number to be unlocked. And the clever Kami has left a puzzle on the case which must be cracked to unlock the case. On the case, is displayed a string, $S$ of length $N$ consisting of lowercase alphabets. To unlock, he needs to convert this string into a pin number $R$. The trick to creating that pin lies in his name $[f, r, i, e, z, a]$. Every character in $S$ is either $good$ or $bad$. It is $good$, if it is a part of the letter set $[f, r, i, e, z, a]$. It is $bad$ otherwise. He'll have to traverse $S$ one by one and count consecutive letters that are $good$ or $bad$ and then store these corresponding counts in the same order in $R$. Thus the pin number, $R$ will be a concatenation of the counts of these letters. See Sample Input for more details. You have to help him find out $R$. ###Input: - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - Each test case contains a single string $S$ consisting of lowercase characters $[a-z]$. ###Output: For each test case, output in a single line answer denoting the decoded string which Frieza can use to attain immortality. ###Constraints - $1 \leq T \leq 5$ - $1 \leq N \leq 10^5$ - $S$ consists of only lower case alphabets. ###Sample Input: 2 krillinisdead futuretrunks ###Sample Output: 122111221 132114 ###EXPLANATION: *Example case 1:* The string $S$ is "krillinisdead". The letter, "k" does not belong to the set $[f, r, i, e, z, a]$ and hence it's count, i.e., 1 is appended to the string $R$. "ri" belongs to the set $[f, r, i, e, z, a]$ and hence 2 is appended to $R$. "ll" doesn't belong to the set $[f, r, i, e, z, a]$, so it's count 2 is appended to the string $R$. The string $R$ keeps getting updated and the final answer is returned when the input string has been completely traversed.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.