7 kyu
Check digit
732 of 1,646Dmitry Kudla
Loading description...
Fundamentals
Strings
Puzzles
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.
Description should be language-agnostic
Python update (new testing framework)
Approved!
For Python In part 'Kata Description', block 'Find more details below: ', row 3 there is a typo. Right so: checkDigit(67845123654000, 4, 2, 5) -> true, 5 exists in 845
Changed.
Thank you
This comment has been hidden.
In the description, it says:
It should say either
0 <= index1 < 14
or0 <= index1 <= 13
and the same forindex2
, because of course if the length is 14, then 14 is not a valid index.done
This comment has been hidden.
It seems that's a bug, already warned the kata's Ruby translator to fix it.
Thanks for your patience. Fixed!
Haskell translation Kumited
Please review and approve.
done, thanks
Ruby translation Kumited.
Please review and approve.
This comment has been hidden.
Fixed!
Python translation Kumited.
Please review and approve.
I suggest you replace the first line
Does exist an argument digit in an argument number in specific snippet? This snippet is defined by two argements: index1 and index2.
with the following:"In this Kata, you will be given a
number,
two indexes (index1
andindex2
) and adigit
to look for. Your task will be to check if the digit exists in the number, within the indexes given".The first line as it is makes the Kata unapproachable.
I agree with you, this kata description needs to be re-worded.
done
Why is this so difficult to understand, despite my 'attentiveness?' (Btw 'argements' s/b 'arguments.')
I added an additional description for kata.
Got it! Thank you!
Approved ;-)
great)
You do not specify which argument is
digit
, which isnumber
, etc.The kata becomes a puzzle that way, but it does not have the
puzzle
tag.Examples 1 and 2 contradict each other.
I've read the description attentatively. I really can't find a specification what order the arguments are in.
This
( or something like it ) would define what order arguments are in.
So
digit
, of course, is the 4th argument.That leaves me wondering how
1,0
and0,1
both result in the snippet12
.I got it. Look please, in the description we have
Be careful, the index2 is not necessarily more than the index1.
It means ((index1 == 2 && index2 == 5) == snippet from 2 to 5) == ((index1 == 5 && index2 == 2) == snippet from 2 to 5)I added this additional description for kata.
Also, I think it's worth mentioning that the right hand bound is inclusive, i.e digits from index
index1 <= i <= index2
(assumingindex2
>index1
).Thanks, you are magnificent as always
JS numbers are always double, so they have a precision limit.
123456789123456789
in the fixed tests definitely goes above the limit.You can see the maximum safe integer with
Number.MAX_SAFE_INTEGER
and check if a number is safe by usingNumber.isSafeInteger
.I've change it in Sample Tests. Regarding main tests there is constant number's length == 14 (safe)