blob: fdd8032691a2a354b04db17369481e9d96049044 (
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
28
29
|
import sys
## Example 1
## strInput = "Perl"
## strCheck = "Preel"
## Example 2
## strInput = "Weekly"
## strCheck = "Weeakly"
## Example 3
strInput = "Box"
strCheck = "Boxy"
arrUniqCharInput = list(set(strInput))
arrCharInputCount = [strInput.count(charLoop) for charLoop in arrUniqCharInput]
arrUniqCharCheck = list(set(strCheck))
arrUniqCheck = [strCheck.count(charLoop) for charLoop in arrUniqCharCheck]
for nIndx, charLoop in enumerate(arrUniqCharCheck):
if charLoop not in arrUniqCharInput:
print (charLoop)
sys.exit()
if arrUniqCheck[nIndx] > arrCharInputCount[arrUniqCharInput.index(charLoop)]:
print (charLoop)
sys.exit()
|