Reči - Okružno
Little Perica has recently started school and he has already learned how to read. Since Perica is a hard-working and honest student, he asked his teacher for a task where he could test his knowledge. The teacher, happy for having such a good student, immediately gave him a task.
Perica has been given a little dictionary R, containing n words. Besides that, the teacher also gave him a list L containing m words. His task is to test each word out of the list L in the following way: For each word out of the dictionary he must find all of its occurences in the word he's testing and cross out each occurence. In the end, Perica must tell his teacher the amount of words from the list L that have each letter crossed out at least once.
Help the teacher by making a program that determines how many words out of the list L will be completely crossed out, so she could check Perica's work easier.
6
paja ram papa ma lama lig
7
papaja
salama
papaje
ramalama
mara
mama
miligramOutput:
3Explanation: There are three completely crossed out words: papaja, ramalama, mama.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.