6 kyu
VIN Checker
438 of 845lfhohmann
Loading description...
Strings
Logic
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.
Really nice kata and concise, step-by-step description. Thank you!
I'm getting this error: 8WXSY7WGXBM122383 should be invalid! expected:true but was:false When I run the code with my IDE I get true.
Liked this kata, it helped me reaqaint myself with array and arrow functions
Thanks for creating a great kata. Quite tough for a 6, but very enjoyable!
I enjoyed this kata, thanks for putting it together.
I only fail Fixed Tests where I can see Fixed Tests. Input Validation Tests -> true Random Tests -> true
In which language?
javaScript . thanks.
I have already found a solution.
Here's a Racket translation.
Approved by someone
I liked this kata a lot.
I had a strange problem, I even output the value for modulus 11 for verification, so, comparing the check and what the program output was strange, that is, modulus 11 was equal to 3, and in place of the 9th number there was a digit 2, that is, they are not equal and therefore the answer should be False, but it was written in the tests that it should be True
Can you post the VIN number? Did it happen on the Random Tests or Fixed Tests?
3YC1DG6T7FY565964 for this vin modulus 11 is 9 test said that this one is valid
or one of the fixed tests 5HVA1C6ZXPA702445 modulus 11 is 10 and it must be valid number, but test said it must return False
For 3YC1DG6T7FY565964 the sum is 458, modulo is 4. for 5HVA1C6ZXPA702445 the modulo is 7. You should revise your code.
First example: translated "38314763768565964" =>
3 * 8 = 24
8 * 7 = 56
3 * 6 = 18
1 * 5 = 5
4 * 4 = 16
7 * 3 = 21
6 * 2 = 12
3 * 10 = 30
7 * 0 = 0
6 * 9 = 54
8 * 8 = 64
5 * 7 = 35
6 * 6 = 36
5 * 5 = 25
9 * 4 = 36
6 * 3 = 18
4 * 2 = 8
24+56+18+5+16+21+12+30+0+54+64+35+36+25+36+18+8 = 458
thank you for your help, using your example, I figured out where there was an error in the code and was finally able to solve it, as a result, the error was in a loop that multiplied two lists and gave incorrect values
Is it just me or is this part of the instructions confusing? First line is clear, 2nd is not...to me. After some testing, it seems that the reference to 'digit' is the same as the reference to 'character' in the previous line. The different verbiage makes it seem like they are two different things.
If the 9th character matches the modulus 11, the VIN is valid. Note: If the modulus 11 of the sum is equal to 10, then the digit is "X".
Fantastic Kata. I have learned alot doing this exercise that it felt like a project because it was really tough haha. Thanks for this Kata.
Julia translation
Approved by someone
Approved
Java Translation
Thanks for the translation!
No problem
Cool kata!
I'm a bit confused. Test was ok. And when I clicked the Attempt button I got 200 or more passed tests and a few failed. Thing is it's showing that I haven't passed the first three tests! Aren't they the same as in the first "Test" instance? How can I find out what exact input was causing it? In Python.
You can add a
print(number)
statement at the beggining of your function, so you can see which inputs are passing and which ones are failing.Wow, that's a great function. It works. At least I can see now what's the problematic VIN code. Cheers for that.
This comment has been hidden.
The vin number
8WXSY7WGXBM122383
should returnFalse
, it is invalid. The check digit isX
but it should be7
.Well, I thought that X was translated to 7 anyway. Ok then, I added a line for this combination and I've passed all tests :-)
Thanks!
I'm having the same issue you had (only failing the first 3 tests). I recognize that each of these 3 VIN numbers have "X" as the checker digit, yet I still cannot figure out what I am doing wrong. Can you help explain to me how you were able to solve this?
I added one elif line where I mentioned mod==7 and number[8]=="X".
Hope it helps... I don't want to write the exact line. But it's a short line anyway...you'll make it :-)
This comment has been hidden.
Good point!
Thanks for the input
There are no mentions about input validation being mandatory anywhere.
Also it's called "Edge Cases" in actual tests: wut? They're not edge cases, they're input validation tests. Calling them edge cases is misleading.
Thanks for the input
Hi,
6RSY30NPXLL354825 -> False
If the modulus 11 of the sum is equal to 10, then the digit should be replaced by "X"
is incorrect:=>replaced by "X"
be "X" in the plate
-
should be considered invalid should be added (the user shouldn't have to go look somewhere else to find the actual requirements), and this makes this sentence wrong:VINs are 17 characters long, its composed of capital letters (A-Z) and digits (0-9)...
Valid VINs are...
)Cheers
If the modulus 11 of the sum is equal to 10, then the digit should be replaced by "X"
sentence-
character from the conversion table and better explained the "I","O","Q" situationVINs are 17 characters long, its composed of capital letters (A-Z) and digits (0-9)
sentenceValid
to the begining of theVINs are exactly 17 characters long
sentenceThanks for the feedback
How should we handle the number '-'? What are we to do about that footnote? We need to change the input and rerun the verification process?
I had to use wikipedia to find the correct algorithm.
.
I'm sorry for not being clear in the description about the "-" char. Already fixed it and added a link for an online VIN checker so people can better understand how it works.
Thanks for the input.
Input validation is not mentioned anywhere. The
VINs must be exactly 17 chars long
cases are poorly implemented as my solution passes them without any special logic. This solution replaces"I"
,"O"
, and"Q"
with"0"
which happens to work even though it shouldn't.Fixed both issues, thanks for the feedback.