-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoding_Test.py
More file actions
47 lines (44 loc) · 1.12 KB
/
Coding_Test.py
File metadata and controls
47 lines (44 loc) · 1.12 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 1
# import re
#
# def solution(S, C):
# # write your code in Python 3.6
# answer=''
# exist={}
# C=C.lower()
#
# for st in re.split(',\s',S):
# sp=re.split('\s',re.sub('[-]','',st.lower()))
# check=sp[0]+'.'+sp[-1]+'@'+C+'.com'
#
# if check not in exist:
# exist[check]=2
# answer+=st+' <'+check+'>, '
# else:
# answer+=st+' <'+sp[0]+'.'+sp[-1]+str(exist[check])+'@'+C+'.com>, '
# exist[check]+=1
#
# return (re.sub(',\s$','',answer))`
# 2
# import re
#
# s="""
# 348543545 23 Sep 2009 system.zip
# 3485423124 23 Feb 2009 sys-tem.zip
# """
#
# def calc(size, m, y):
# months=['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
# if int(size)>=240*(2**10) and (int(y)>1990 or ((int(y)==1990) and (months.index(m)>0))):
# return True
# return False
#
# def solution(S):
# answer=0
# p=re.compile('(\d+)\s\d+\s(\w+)\s(\d+)\s\w+.\w+',re.DOTALL)
#
# print(p.findall(S))
# for size, m,y in p.findall(S):
# if calc(size,m,y):
# answer+=1
# return answer