This is my solution to the Hamming problem in Ruby:
I tried to improve readability by creating the helper class methods base_distance and both_exists?. I also wanted to play a bit with map and reduce.
You can see two other versions here. I used zip in all of them.
This exercise served me to practice a bit with some Ruby collection functions.
No comments:
Post a Comment