5 kyu
Rearrangement of Numbers to Have The Minimum Divisible by a Given Factor
110 of 151raulbc777
Loading description...
Fundamentals
Mathematics
Sorting
Logic
Strings
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.
Why are the results so truncated? I can't debug my code with something like:
With k = 1, arr = 47,81,43,130,32,107,311: expected 'Rearrangement: 107, 130, 311, 32, 43,…' to equal 'Rearrangement: 107, 130, 311, 32, 43,…'
Python: in rare cases some random tests expect 2 spaces before the word "generates" (when there are multiple rearrangements, to be exact).
python new test framework is required. updated in this fork
Approved!
Javascript translation
Approved. +1
Hi, I got this result from the first simple test.
'Rearrangement: 32, 3, 34, 7, 12 generates: 32334712 divisible by 4' should equal 'Rearrangement: 12, 3, 34, 7, 32 generates: 12334732 divisible by 4'
Mathematically, any combination which ends witn 12 or 32 could be divided by 4.
This is not an issue. Read the description carefully.
Ah I missed 'minimum number'.
Thanks.
Go translation
Approved!(+1)
D translation
Another thumbs up for you.
Rust translation, I have included some changes in the description to facilitate the addition of other languages.
Approved! (+1)
Empty
it
blocks must be removed from tests.Done for Python. If there is an issue in some other language, please say which.
"A, B and C"
or"A and B and C"
-- currently it's not testedleading zeros could/should be tested, e.g. [0, 1, 2] --> 102 (not 12)"Rearrangements: ... generates"
should be"Rearrangements: ... generate"
(without the final"s"
)This comment has been hidden.
Approved
An orthography mistake has been corrected:
arrangement
for the misspelledarrengement
, so the function will berearranger()
instead ofrearrenger()
(misspelled).Hi, I'm getting this result from a random test:
should equal
As you can see both answers are correct according to the instructions, the order of
2
and22
in the answer makes no difference to the concatenated integer!MMMmm.. You found an important point here. Let's work on it. I'll put this in the instructions as an example of special cases that should be handled differently if you don't mind.
I think it's fixed. I'm very grateful for your contribution. I had to make some changes in the details. Let me know if you think it's working properly
OK, that's fixed, one other minor problem though...
'Rearrengement' should be 'Rearrangement'
Oh, I didn't notice this orthography mistake. Thanks. I'll fix it. Your solution will need the correction to pass all the tests
All part of the fun of the beta phase! :)