Skip to content

Instantly share code, notes, and snippets.

@drew-t
Created June 26, 2016 21:22
Show Gist options
  • Save drew-t/04af4f9086dd9899f858a2a87455b85c to your computer and use it in GitHub Desktop.
Save drew-t/04af4f9086dd9899f858a2a87455b85c to your computer and use it in GitHub Desktop.
##Leap
My code: [here](http://exercism.io/submissions/8c56e59a0a2b47189f3d771527b60d0e)
* Responder #1 ([here](http://exercism.io/submissions/2aaa103d3df4428485950574c056d645))
- uses a single line && || operation. very nice versus my if else
* Responder #2 ([here](http://exercism.io/submissions/3641b7941aa9403c8633e8d420bbc317))
- very similar to mine. if, else if, else for every possibility
* Responder #3 ([here](http://exercism.io/submissions/f3609179f03649d9bfcba070b24277ba))
- again, similar to mine
* Responder #4 ([here](http://exercism.io/submissions/89610e20a7074240b60265819e275dd7))
- same, but combines 2 conditions into one line with an && !=
* Responder #5 ([here](http://exercism.io/submissions/f2ea158c833f40589531bb90a0933cfb))
- another combined and/or statement
##Hamming
My code: [here](http://exercism.io/submissions/463e94cdfd304bd68cb930ce624f3d19)
* Responder #1 ([here](http://exercism.io/submissions/ab931374671545d59ecd5aa03886ae35))
- very similar to mine, slightly different order
* Responder #2 ([here](http://exercism.io/submissions/6209ea3ea79c49539bddb573f9b0b211))
- this removes the else clause, since the error is thrown at the top if necessary it breaks out or continues on to finish the rest, slightly cleaner
* Responder #3 ([here](http://exercism.io/submissions/2385e2744d884d89955a609f17f15fdc))
- same as above
* Responder #4 ([here](http://exercism.io/submissions/b4d061c8c1084d5684e06d29cb2f310f))
- same as above
* Responder #5 ([here](http://exercism.io/submissions/1154b1c4ad154c229e4be03251a83f92))
- everything is broken out, it seems a lot more complicated to read and understand this way. Much larger as well
##RNA Transcription
My code: [here](http://exercism.io/submissions/6c0dee3573d947e6b3ded18622a0b4e2)
* Responder #1 ([here](http://exercism.io/submissions/b5feac66f06c48c39998424195c8cce4))
- uses an if/else if strategy. slightly longer and muddied
* Responder #2 ([here](http://exercism.io/submissions/566eff6a1a9443fc98966090ee3f88a0))
- similar to above, however just has several if statements for each possibility, would hypothetically be wasteful of processing to not break out when it's found the correct rna type
* Responder #3 ([here](http://exercism.io/submissions/d6b85dcc868a458e8bb32657f226882b))
- same as mine, but uses a symbol(?) instead of string for key identifier in the hash
* Responder #4 ([here](http://exercism.io/submissions/743ea3ede96140f7a5b8de1654a8e7c0))
- same as mine, though he creates hash inside block, seems unnecessary, global variable would be fine if not better choice
* Responder #5 ([here](http://exercism.io/submissions/ad0fc5a05271474a8e751b517c5c9d35))
- similar approach, though broke the logic inside the block down a little differently, maybe didn't realize that strings had index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment