blob: ae16d9a130160eb94c9f86517792d35e3c3a68b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
## Example 1
## strSentence = "Perl Weekly Challenge"
## arrKey = ["l", "a"]
## Example 2
## strSentence = "Perl and Raku"
## arrKey = ["a"]
## Example 3
## strSentence = "Well done Team PWC"
## arrKey = ["l", "o"]
## Example 4
strSentence = "The joys of polyglottism"
arrKey = ["T"]
arrKeyLower = [charLoop.lower() for charLoop in arrKey]
nCount = 0
for wordLoop in strSentence.split():
## print (wordLoop)
arrContain = [charLoop for charLoop in wordLoop.lower() if charLoop in arrKeyLower]
if len(arrContain) == 0:
nCount = nCount + 1
print (nCount)
|