7 kyu
lucky number
343 of 3,982nakulgupta18
Loading description...
Fundamentals
Mathematics
View
Career Accelerator
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.
lol that's a great 7kyu kata. like being basic yet revealing some of mine elementary math illiteracy
how can "the sum of all digits" be 0 in any case which isn't 0 it self?
python new test framework
Approved
This comment has been hidden.
спасибо за коммент, а то не поняла из условия
hm. That's true.
Звучит как не правда.
A little typo in the description: "36 is divis[i]ble by 9,"
Damn completely forgot that if the sum of the digits is divisible by 9 then the whole number is divisible by 9
testRandomNumbers Log 93 0 expected:false but was:true here is mistake, 0 should be true
seriously...? :o
93 -> 9+3 = 12 => not multiple of 9...
my program counts well System.out.print(LuckyNumber.isLucky(93)); false System.out.print(LuckyNumber.isLucky(0)); true
Mmmmh... that's weird.... Paste your code (with the spoiler flag), please
This comment has been hidden.
This comment has been hidden.
Well, my dear... Your code is actually wrong. Because of this:
EDIT: well, actually no, it's just totally wrong, in fact. It seems it passes the tests only by chance. Now that you can see the other answers, you'll be able to figure it out.
you're right i did not htink about it
Hu, though there was effectively a problem: the random generator could create negative numbers. I fixed that (this does not happen in the other languages).
This comment has been hidden.
this cata is badly made
@nakulgupta18
,Python 3 isn't available because of a single character! Simply changing
xrange -> range
(inTest Cases
) should fix it.Thanks!
py3 compatible.
Javascript translation kumited.
A very enlightening kata. Thank you sensei!
Haskell and Python translations kumited.
Don't use abbreviations. Just write "number".
done.. thanks