Day two Kotlin Hacktoberfest#359
Open
d-l-mcbride wants to merge 17 commits intoCodeToExpress:masterfrom
Open
Conversation
aaditkamat
reviewed
Oct 15, 2020
| **/ | ||
|
|
||
| fun hammingDistance(first: String, second: String ):Int { | ||
| var distance = 0 |
There was a problem hiding this comment.
Suggested change
| var distance = 0 | |
| if (first.length != second.length) { | |
| return -1 | |
| } | |
| var distance = 0 |
There was a problem hiding this comment.
You need to check whether the strings are of equal length before you calculate the Hamming distance between them.
Contributor
Author
There was a problem hiding this comment.
@aaditkamat I have made the changes that were suggested
Contributor
Author
There was a problem hiding this comment.
@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 <dmcbride@dmcbride.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please make sure you have done the following:
/Day<n>/<Language>//Day <n>/all-contributors-cli