7 kyu
If you can't beat 'em, join 'em!
349 of 782megawatt
Loading description...
Fundamentals
Arrays
Algorithms
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.
This kata is nice. It should be rated waay higher.
Missing imports in Python
Sample tests are not using latest framework
Description should be language-agnostic
Out of curiosity, how long do new kata typically stay in Beta? Is more than a year pretty standard?
There's no good standard for this. Some kata never leave beta because they have lingering issues authors do not want to fix. Some manage to collect enough negative feedback that they cannot get to approval requirement, but not enough to get retired. Difficult kata or kata in unpopular languages can stay a year or so before they get enough solutions. Relatively easy kata with not many issues and authors actively fixing them can get out of beta in a matter of days, often accompanied by a bunch of translations.
Interesting. Thanks for the insight.
This Kata was never approved, because FArecashew filed an issue that was basically an opinion which therefore couldn't be resolved. I humbly disagree with FUkissU so I marked his 'issue' resolved, clearing it for approval. Which I will do after I finished this comment. With an average satisfactory rating of 88% this is good enough.
There's nothing new in sorting an array or finding the sum of its elements, and the whole thing is pretty much a combination of these 2 katas:
What should we do then? I agree that it can be considered a combination of those other katas, but many 6 kyu katas are just combinations of easier katas.
Here are some examples of other 6 kyu kata that can be considered to be made of concepts from easier katas:
https://www.codewars.com/kata/556deca17c58da83c00002db (tribonacci square) Is the same as calculating the fibonacci sequence of which there are dozens of, but with adding the three preceding instead of two preceding
https://www.codewars.com/kata/5264d2b162488dc400000001 (Stop gninnipS My sdroW!) Can be considered a combination of: https://www.codewars.com/kata/5168bb5dfe9a00b126000018 (reversed strings) and https://www.codewars.com/kata/566f571ed78037c7b6000036 (get length)
https://www.codewars.com/kata/551dc350bf4e526099000ae5 (dubstep) Is pretty much https://www.codewars.com/kata/5547929140907378f9000039 (vowel remover) but with "WUB" instead of vowels
https://www.codewars.com/kata/54bf1c2cd5b56cc47f0007a1 (counting duplicates) is pretty much https://www.codewars.com/kata/5558cc216a7a231ac9000022 (finding duplicates) but counting the results instead of returning it
This one is about combining separate arrays into one array based on descending array value. It's not a completely original idea, but I don't think it's been submitted before. I seriously think this kata is fun, challenging, and unique enough to be considered its own.
If anything at least it's a combination of other katas instead of a straight up duplicate with some elements changed around (WUB instead of vowels, returning the amount of duplicates instead of returning the duplicate values themselves, fibonacci but with adding up the three preceding numbers instead of two, etc).
The kata should be made more original? As it currently stands, this is a combination of some entry-level tasks, and that's a totally uninspired approach to authoring. As of some katas you've mentioned there's nothing to be done. They've all been created and approved long before the content-moderation was a thing, so practically any garbage could leave Beta easily as long as people who didn't care about CW's overall content-quality in the slightest were satisfied (basically, what's happening here).
Would adding strings to the arrays and have them still sort it by total sum of the integers while preserving string order, be original enough? i.e.:
?
It would be no-one-should-ever-do-that enough. What real life use case of such mixed-type lists can you think of?
I don't see the hypothetical adding of strings into the arrays as having much if any real life application, but I do see the original version of this kata having real life applications such as when sorting a list of arrays based on descending total value. I'm just brainstorming ways to make this more original even though I already think the current version of the kata is good enough.
There can be real life mixed arrays of ints and strings though.
For example you are allowed to set usernames on Facebook which gives you a custom URL like Facebook.com/user/megawatt (just an example). If you don't set the username, it defaults to userid so something like Facebook.com/user/123456.
Put that into an array based on ending url to access the user page and you can get something like [123456, "megawatt"]
anyway I'll think about other ways to make it better.
But it's still a string. And, mixed types in anything are not a good practice.
.
Haskell translation
Approved, thanks!
PHP translation
Approved, thanks!
Description should be updated to be different per language. i.e. lists should be called arrays in JavaScript, functions in description should be changed depending on convention.
Kinda messy, but fixed. :)
Excellent work, thanks so much!
The user can modify the input in JavaScript.
The tiebreaking condition when lists have equal sum is not mentioned. The test assumes that they are kept in the same order as in the original array, which should be added to the description.
Tiebreaking condition added to the description, please check if it's sufficient.
Small grammar error + it is when lists have equal sum, not same array; somethin' like this:
You're right, updated.
:+1:
JavaScript translation Crystal translation Ruby translation CoffeeScript translation TypeScript translation
Thank you for these translations, the JavaScript one has been approved, the Crystal one looks like it has been approved but it doesn't show up??? The Crystal one may have glitched.
This error keeps popping up when I try to approve the other ones: Description cannot be approved, recent changes from related record must be merged first.
How should I fix it myself so in the future you don't have to always come back here and fix it?
Fork the translation and fix the conflicts in the description. Also, Dart translation
Crystal: Fork the translation and add whitespace so it will let you. Also ruby one fixed: https://www.codewars.com/kumite/5d431fb9f87d320016ec75df?sel=5d4329379a1da1002a070248
Ah thanks, that was a lot easier than expected. Ruby, Crystal, and Dart have been approved.
@FArekkusu said above that the JavaScript had an issue, would the CoffeeScript and TypeScript translations have that issue as well?
Yes. I fixed JS through Kata Editor, the other ones are fixed through forks. Also, I just realized that even the reference solution modifies the input, so fixed too. Forks: https://www.codewars.com/kumite/5d43243d86f926001640fed5?sel=5d432f9078b7b3000e118140 https://www.codewars.com/kumite/5d432289ddd7d4002dab1f10?sel=5d432fbb81bbed001edf6db8
Both have been approved, thanks!
By the way, the glitch in the Crystal translation is because of this bug: https://github.com/Codewars/codewars.com/issues/1793
Ahh interesting, at least we got it working now!
( JS, possibly othes )
Random generator has a bug: missing
+ min
.Oops, fixed :smile:
This comment has been hidden.
Sorry about that, it has been fixed, please test
it's ok, now.