Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
defpart_one():word_twice_count=0word_three_times_count=0withopen('input.txt','r')asinput_file:forlineininput_file:line_counter=Counter(line)if2inline_counter.values():word_twice_count+=1if3inline_counter.values():word_three_times_count+=1checksum=word_twice_count*word_three_times_countprint'checksum is '+str(checksum)
My edited solution for part one with collections Counter
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice! Don’t forget about collections.Counter for part 1! I didn’t know about difflib though. Cool!
Thanks for the hint! Will do that later!
My edited solution for part one with collections Counter