2023 Huawei OD Machine Test Paper C [Master the Number of Words] Java Implementation

Table of contents

topic

Ideas

Code


topic

has a string array words and a string chars. If you can use the letters in chars to spell out a "word" (string) in words, then we think you have mastered this word.
The characters of words only consist of a-z English lowercase letters , such as "abc"
chars consists of az English lowercase letters and "2". The English "?" represents a universal character, which can be used as any English letter when spelling. For example: "?" can be regarded as letters such as "a"
Note: Every time you spell, each letter and universal character in chars can only be Use once
to output the number of all the words you know in the vocabulary word list. If no words are mastered, 0 is output.


Input description
The first line: Enter the number of words in the array, recorded as N.
Line 2 ~ Line N+1: Enter each string element of the array words in turn
Line N+2: Enter the string chars a>Remarks Output an integer representing the number of words you know in the vocabulary word list
Output description

Supongo que te gusta

Origin blog.csdn.net/misayaaaaa/article/details/134913639
Recomendado
Clasificación