Skip to content

Instantly share code, notes, and snippets.

@roscalabrin
Forked from anonymous/exercism.markdown
Last active October 13, 2016 23:28
Show Gist options
  • Save roscalabrin/0fc0d585910eb0c1d4f376b502735484 to your computer and use it in GitHub Desktop.
Save roscalabrin/0fc0d585910eb0c1d4f376b502735484 to your computer and use it in GitHub Desktop.

##Leap My code: here

  • Responder #1 (here) - This solution is very close to mine, but with a one line return method, which makes it more efficient.

  • Responder #2 (here) - I liked this implementation. It's short and clear. Rather than using a if statement, this person is just returning the result of a combination of comparisons (true or false).

  • Responder #3 (here) - This person used a nested conditional, which made the implementation more complicated than what it needed to be.

  • Responder #4 (here) - This solution used an if statement, however the user added an extra step to return false in case that the else if statement evaluated false, which is unnecessary.

  • Responder #5 (here) - This solution didn't use a prototype function, it rather adds the function inside the object. The problem with this solution is that when you bind a function to the object keyword, you're providing the function just to that particular instance of the object.

##Hamming My code: here

  • Responder #1 (here) - This solution is almost exactly like mine. I liked that the user declared the count variable after the if statement.

  • Responder #2 (here) - This solution also didn't use a prototype function, it rather adds the function inside the object. In this implementation, compute is a property of one particular instance of the object. Using a prototype function would be preferred. The variable names are a bit confusing.

  • Responder #3 (here) - This approach uses a nested if statement, which makes it more complicated than what it needed to be.

  • Responder #4 (here) - This approach is almost identical to mine, but is uses reduce to set a variable sum that will serve as the counter.

  • Responder #5 (here) - This last solution is essentially the same as mine with difference variable names.

##RNA Transcription My code: here

  • Responder #1 (here) - This solution uses a if statement nested inside a for loop, which makes the implementation more complicated that what it needs to be.

  • Responder #2 ([here]http://exercism.io/submissions/7bd2031155f14935af37eafa15c8476f)) - This approach is similar to mine, but the use of map with an arrow function made it more efficient.

  • Responder #3 (here) - This response seems more complicated than mine. It uses cases inside a for loop.

  • Responder #4 (here) - I liked this solution a lot. Leaving the 'translation' as a property of the dnaTransciber makes a lot of sense.

  • Responder #5 (here) - This solution is similar to mine as well, but slightly more complicated at the end with the for loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment