6 kyu
Group in 10s
415 of 1,091matthewglover
Loading description...
Arrays
Lists
Fundamentals
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 example strongly implies that empty slots should be filled with 'undefined' but the solution reveals empty slots are to remain empty. Description should state "Empty slots are to remain empty".
D translation
HI all, I just figured out how to check the tested input and its awesome :)
however I am struggling here to find out how to replace the undefined or empty arrays (groups that are empty but not at the end of the groupings array).
So like instead of: [[1,2,3|,[12,15],,[34,37]
I have [[1,2,3|,[12,15],undefined (or []),[34,37]
Can somebody help me please? I really worked many hours on this issue and I would love to be able to submit it :)
Thanks, Ra
I really enjoyed this kata, thanks!
hi all, I have solved the issue on JS in my visual code studio but cannot pass the tests.
for example this input: console.log(groupIn10s(1,12,24,17,41,62,99,73,3)); gives this output:
[ [ 1, 3 ], [ 12, 17 ], [ 24 ], undefined, [ 41 ], undefined, [ 62 ], [ 73 ], undefined, [ 99 ] ]
I think i don't know yet (new here) how to test and run codes.
Can somebody pls help me? Thanks
Hi. It's not clear what's the problem you are trying to point out here. Could you be more explicit please? Maybe start reading there: https://docs.codewars.com/getting-started/solving-kata
I tried your code on sample tests and it gives things like that:
Which means your code return the first array (array with several
undefined
s while it should have returned the second one[[1,2,3]]
). This is a good starting point to try debugging your code.Hi Akar, thank you.
I think it might be the length of the solution array. Ill try to change that or come back with better explanation.
Best, Ra
This comment has been hidden.
sorry I wasnt able to put it in a better form. I am not really getting codewars I think :(
Too sad that there is no php version for this
One could say the same for other 51 languages, or thousands of other katas... suggestions are expected to be concrete ideas of improvements of a katas, not plea for new languages. There will be a translation in PHP when someome works on it and gets it approved.
How can we particapate for this. If for exemple I want to add it myself ?
You can refer to the official documentation, but I think it's quite incomplete about this topic: https://docs.codewars.com/authoring/guidelines/translation
Once you solved (or forfeited) a kata, you should see new tabs appear at the top page, below the title and the statistics:
Solutions - forks - ... - Translations
.If you click on
Translations
, you get to a new page, where you can see, at the top, the translations awaiting approvals, and below all the approved translations. Between them, you have a boxTranslate
. If you click it, you get to the translation editor page. You can select any languages the kata has not been translated into (for examplePHP
for this kata), and then you can edit the translation, reference solution, sample tests, attempt tests, and solution set up. Once you have your translation published and think it's ok, you can post a suggestion on the Discourse page, so that other users can review it and approve it, fix it or give advices about it.If you have concrete questions and have the opportunity, maybe it's handier to ask them on the
#help-translate
channel of CodeWars' Discords server (link is in the left panel).Yeah I just wanted to point to the same page and yet again I remembered that I have the "How to translate a kata?" tutorial in my backlog for waaaaay to long :(
Thank you for the response. I gonna see if I can do it. Thanks again.
python why is there no arguments in this function? and why the test arguments are just comma-separated numbers? should it be a list? please, correct me if i'm wrong
This is a variadic function. You can have a look there to see how it works: https://www.freecodecamp.org/news/args-and-kwargs-in-python/
You can add
*args
as arguments and do your job.I published a new version of the translation, if you want the new set up, save your code locally and click
reset
in the trainer.oh my god, thank you so much. i even haven't heard about that
LC translation
This translation modifies the description
approved
it's a pity I almost got everything right except for that whitespace for an empty array
What whitespace? You just have to fill the appropriate spots and forget about the rest.
solved it already
JS: Users can modify the inputs.
Fixed
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai). Refer to this and this
Updated to Node v14
It would be more challenging if the numbers was higher than 100.
but still a good 6kyu kata anyways.
How would that make it harder?
There would be time complexity issues if we have more elements to sort So we are forced to come up with better solutions.
jesus........ i just pretty much brute forced my way into a solution.
This felt way way harder than other 6 kyu problems
Ruby 3.0 should be enabled.
Enabled in this fork
It should be mentioned how high numbers will be tested. For python it's only up to 100 (why not higher?), IDK about others.
C#-Translation kumited!
https://www.codewars.com/kumite/57d66b6f1a6282a1580001a6
Please check and approve it! :-)
A nice translation for your kata is waiting! :-)
Hi - thanks very much for the translation and sorry for the slow response as I've not been on Codewars for a few months. I've merged your translation, (although I'm not too familiar with C# so not really in a position to give valid feedback on it!).
Great kata! Thanks!
Python instructions are missing an example of required output.
Not anymore
Why
grouped[4] = null
? Why notgrouped[4] = []
? That way, all elements of your result would be arrays.I wondered about it as well, but then I took it as an extra challenge and rated the kata accordingly; not sure if the author did so on purpose, though...
Thanks for the suggestion - I can certainly see there is an advantage in having consistent types in the return value. The aim of my solution was to have a return like
[[1,2], ,[21,22], ,[40]]
rather than explicitnull
values because this works nicely with Array.map and Array.forEach (by just iterating over the values actually set). The problem I think is the wayTest.assertSimilar
does the comparison, which sees an empty element in the array asnull
so would see the array[1, null, 3]
as similar to[1, , 3]
.Upvoted, ranked, translated; thanks for your work matthew :)!
That's great - thanks Giacomo