python-challange/2/counter.py
2021-10-31 00:04:40 +02:00

30 lines
558 B
Python

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()