Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day two Kotlin Hacktoberfest #359

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

d-l-mcbride
Copy link
Contributor

@d-l-mcbride d-l-mcbride commented Oct 12, 2020

Please make sure you have done the following:

  • Created a folder with the name of language you code inside directory for the day you are making the contribution to
  • Added the source code file inside /Day<n>/<Language>/
  • Tested your code
  • Added credits (author and date) at the top of the code
  • Updated README.md for /Day <n>/
  • Added yourself as a contributor using all-contributors-cli

**/

fun hammingDistance(first: String, second: String ):Int {
var distance = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var distance = 0
if (first.length != second.length) {
return -1
}
var distance = 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to check whether the strings are of equal length before you calculate the Hamming distance between them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaditkamat I have made the changes that were suggested

Copy link
Contributor Author

@d-l-mcbride d-l-mcbride Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaditkamat or @MadhavBahl I know you are probably busy but could you verify my changes, since I was trying to get my pull request done for Hacktoberfest. Unfortunately this pull request is actually many day2-4 (forgot to make branches for each). Could you add the "hacktoberfest-accepted" label to this. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants