Solve 2
This commit is contained in:
parent
0efa8136a2
commit
7fa280187b
29
2/counter.py
Normal file
29
2/counter.py
Normal file
@ -0,0 +1,29 @@
|
||||
from collections import Counter
|
||||
|
||||
from utils.Url import Url
|
||||
|
||||
|
||||
def count_string():
|
||||
with open('string.txt') as file:
|
||||
string = file.read()
|
||||
return Counter(string)
|
||||
|
||||
|
||||
def get_lowest(counted_dict):
|
||||
lowest_string = ''
|
||||
for key in counted_dict:
|
||||
if counted_dict[key] == 1:
|
||||
lowest_string += key
|
||||
return lowest_string
|
||||
|
||||
|
||||
def main():
|
||||
counted = count_string()
|
||||
lowest_string = get_lowest(counted)
|
||||
builder = Url()
|
||||
builder.solution = lowest_string
|
||||
print(builder.url)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
1220
2/string.txt
Normal file
1220
2/string.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user