Retired
Hamming Distance - Part 1: Binary codes (retired)
1,245 of 2,918Skratch
Loading description...
Fundamentals
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
The correct is 'Hamming distance', with uppercase 'H'. It is named after the American mathematician Richard Hamming (see on wikipedia).
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/129.
Please join the discussion to help us identify duplicate kata and retire them.
Retired.
Duplicate.
Kata retired.
JS Test Case: Missing describe blocks.
JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)
done
The test structure hasn't been fixed. It's missing
describe
blocks.theyre not necessary, just select a recent Node version. it avoids useless indentation
What do you mean they're not necessary? Just because they appear to be fine doesn't mean they're fine. It's explicitly mentioned here
be petty if you wish, i dont care. the kata works and has been updated to the latest Node version, it's all that matters to me
C translation (author gone)
Approved, thanks :)
Ruby 3.0 should be enabled.
Kata retired.
Attemped a solution in Purescript. All attached tests pass. I'm unable to reproduce failed hidden tests cases.
Error: 4 /= 5 3 /= 0 2 /= 1 0 /= 2 2 /= 1 6 /= 1 7 /= 3 4 /= 1 4 /= 1 4 /= 1 3 /= 2 1 /= 2 1 /= 0 4 /= 6 6 /= 3 2 /= 1 4 /= 2 3 /= 0 5 /= 2 4 /= 0 6 /= 0 4 /= 0 5 /= 3 1 /= 2 7 /= 3 3 /= 2 4 /= 1 4 /= 3 5 /= 2 0 /= 1 5 /= 1 6 /= 5 8 /= 5 6 /= 0 4 /= 1 5 /= 2 0 /= 2 5 /= 1 3 /= 2 1 /= 0 3 /= 5 5 /= 3 3 /= 1 5 /= 3 2 /= 1 3 /= 6 8 /= 1 2 /= 1 4 /= 3 6 /= 4 4 /= 3 5 /= 1 3 /= 1 2 /= 6 3 /= 1 6 /= 1 4 /= 1 7 /= 0 4 /= 5 5 /= 2 1 /= 0 4 /= 0 5 /= 1 6 /= 1 4 /= 3 5 /= 7 8 /= 2 at Object.exports.error (/home/codewarrior/purescript/output/Effect.Exception/foreign.js:8:10) at /home/codewarrior/purescript/output/Test.Spec.QuickCheck/index.js:34:108 at /home/codewarrior/purescript/output/Test.Spec.QuickCheck/index.js:45:58 at run (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:273:20) at Object.run (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:630:13) at run (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:951:21) at runPar (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:990:5) at /home/codewarrior/purescript/output/Effect.Aff/foreign.js:1004:16 at runAsync (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:98:20) at run (/home/codewarrior/purescript/output/Effect.Aff/foreign.js:323:22)
I've fixed a bug, try now. Also, you can print the input using Debug.Trace.
Thank you. The bug is fixed.
PureScript translation published.
PHP Translation Kumited - please carefully review and approve :D
The example test cases in Haskell use the wrong method name.
Fixed.
Confirmed. :)
Careful with your future Hammings; this kata is very similar to what you've already got, and there can't be dups.
Yes, I found that one after I wrote my Kata. For some strange reason, it wasn't shown when I searched for "Hamming" before I wrote the Kata. But I'll make sure not to write a duplicate.
Kata ranked, upvoted and translated into both JS and Ruby if you want to approve them :)
Thanks for your work.
Approved your translations. Thank you for your work! :-)
My pleasure and I sincerely hope I will be able to do the same with the rest of your katas :)
It would be most appreciated!
Minor description adjustment for readability:
Example:
hamming_distance('100101', '101001') == 2
hamming_distance('1010', '0101') == 4
Thanks for your feedback. I changed the description.
I mark the issue as resolved now.