Skip to content

Instantly share code, notes, and snippets.

@catsby
Created June 18, 2014 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catsby/1f87b7fbfbd7da70de2f to your computer and use it in GitHub Desktop.
Save catsby/1f87b7fbfbd7da70de2f to your computer and use it in GitHub Desktop.
exercisms
package etl
import (
"strings"
)
func Transform(input map[int][]string) map[string]int {
m := make(map[string]int)
for k, v := range input {
for _, o := range v {
m[strings.ToLower(o)] = k
}
}
return m
}
class Hamming
def self.compute(first,second)
diffs = first.each_char.with_index.select do |c,i|
c != second[i] unless second[i].nil?
end
diffs.count
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment