Skip to content

Instantly share code, notes, and snippets.

@Laner12
Last active October 13, 2016 17:05
Show Gist options
  • Save Laner12/447980174ef80300538427e08ec3e139 to your computer and use it in GitHub Desktop.
Save Laner12/447980174ef80300538427e08ec3e139 to your computer and use it in GitHub Desktop.

##Leap My code: here

  • Responder #1 (here) - This responder took largely the same approach as me but used this.isLeap vs me using a prototype method and the indentation is different.

  • Responder #2 (here) - This responder used a single line method that seems to use all the same steps that I did but could be considered less readable.

  • Responder #3 (here) - This responder took largely the same approach as me but used an && style if statement which took off the need for one of my else ifs.

  • Responder #4 (here) - This responder took a similar approach to me but used this.isLeap and did a single line return statement.

  • Responder #5 (here) - The final responder used almost the same approach as number 4 but set a var year = this.year to pass to the single line return statement.

##Hamming My code: here

  • Responder #1 (here) - This first response takes an approach similar to me but does the for loop before checking length. They also use string[index] instead of using a method call like me and once again use this. vs a prototype method.

  • Responder #2 (here) - This response takes an approach similar to me but use string[index] instead of using a method call like me, similar to response one.

  • Responder #3 (here) - This approach uses the same startegy as most of the previous but instead of just having a for loop inside the function, they place it inside the optional else which works but I am not to fond of it. They also use distance vs count which I havent seen much.

  • Responder #4 (here) - I thought this was an interesting approach for the use of a filter instead of using a for loop and counter.

  • Responder #5 (here) - The final solution does not follow as closely as some of the other examples do mainly because of using a while loop vs for loop and they set a variable instead of just using this input value.

##RNA Transcription My code: here

  • Responder #1 (here) - The first responder uses a for loop and manually assigns the old value to the new with if/else which works but there are easier ways.

  • Responder #2 (here) - This approach is essentially identical to the fisrt response aside from variable names.

  • Responder #3 (here) - This response uses the same logic as the other two but uses a case statement instead of the longer if/else.

  • Responder #4 (here) - The fourth response uses a very similar approach to me but uses a short-hand map function which seems to take away from the readability.

  • Responder #5 (here) - This final response is very interesting because it looks like ruby and I didnt know you could do single line esle if statements.

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