Skip to content

Instantly share code, notes, and snippets.

@damwhit
Last active May 13, 2016 19:43
Show Gist options
  • Save damwhit/d3669f3d48b0c94e6f79bcf14407b937 to your computer and use it in GitHub Desktop.
Save damwhit/d3669f3d48b0c94e6f79bcf14407b937 to your computer and use it in GitHub Desktop.

My code

##Leap

  • Responder 1 Responder used nested if else statements and also used a parseInt function that I didn't know existed.
  • Responder 2 Responder used one line if statements for all of the logic in this problem.
  • Responder 3 Responder used a nested if within a nested if to get the problem solved.
  • Responder 4 Responder has 3 if/else statements that could be cut down by using some && or statements within those ifs.
  • Responder 5 Responder broke the logic out into seperate prototyped methods and returned the outcome of the methods being called on this. I think that writing it this way made it less readable.

##Hamming

  • Responder 1 Responder used a for loop instead of a forEach loop to add one everytime the nucleotides didn't match.
  • Responder 2 Responder approached this in a way that I really like. I like that he caught the exception of the strings not matching in a oneline if statement instead of my long ugly if/else. I also like that he did not split the strings into arrays as I now see that isn't necessary with a for loop.
  • Responder 3 This responder did it in a very similar way. Big fan.
  • Responder 4 Responder did it in a very similar way to myself. He did catch the exception fist instead of doin an if else however.
  • Responder 5 Responder did it very similarly to responder 1.

##RNA Transcription

  • Responder 1 Responder used a prototype method to convert the dna instead of a variable. It my be more readable this way however it does add a lot of if elseif statements.
  • Responder 2 Very similar approach to myself.
  • Responder 3 Was completely unaware that you could write for statements like this. It is very hard to read this code.
  • Responder 4 Responder used the replace method to do this. Very little code but also slightly harder to read.
  • Responder 5 Responder used the map prototype method to do this. I like it and actually did it this way first before trying a for loop to do it in a more functional way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment