-
Notifications
You must be signed in to change notification settings - Fork 153
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
base: master
Are you sure you want to change the base?
Conversation
**/ | ||
|
||
fun hammingDistance(first: String, second: String ):Int { | ||
var distance = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var distance = 0 | |
if (first.length != second.length) { | |
return -1 | |
} | |
var distance = 0 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
* Add @d-l-mcbride as a contributor * Add Kotlin solution for FizzBuzz Co-authored-by: d-l-mcbride <[email protected]>
Please make sure you have done the following:
/Day<n>/<Language>/
/Day <n>/
all-contributors-cli