6 kyu
Group-by and Sum
251 of 279Fbasham
Loading description...
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.
NICEEEEEEEEEEEE
Haskell translation
Approved. Thanks for contributing.
This comment has been hidden.
Hi Fbasham,
Nice problem! Are you interested in translations?
Regards,
brodiemark
Glad you liked it. Translations are always welcome. Cheers.
Java Translation
It is a good kata. However, in my opinion it is not a 6 kyu kata...
Nice kata!
The grouping keys and aggregated values should be separated, e.g.
[(keys_list_1, values_list_1), (keys_list_2, values_list_2), ...]
. Although I think it'd be better to return a dictionary instead, e.g.{keys_tuple_1: values_list_1, keys_tuple_2: values_list_2, ...}
.Also, my grouping/aggregating explanation has to be copied back into the description from the revisions page (and adjusted for the new requirements).
Hey man, I changed the return type to a dict
Saw your edits to the description. Looks awesome! Thank you.
Hi,
your description is lacking some stuff. A beginner will never understand what you're actually asking for...
Other than that:
cheers
Good points. I think I'll unpublish and re-publish to change the behaviour slightly.
:+1:
note: "please use the new test framework", ofc... x)
For sure. I wasn't even aware there was v1 or v2. Never authored before.
@Fbasham, I've migrated the tests to the new test framework, changed the description a little, and rewrote the example to be more clear about what is grouped and what is aggregated. If it turns out that you were editing the kata yourself right now and overwrite my changes, everything can be restored from the revisions page.
:+1:
Changes look good to me. Waiting for the feedback of the author before closing, so that we are sure about what is the actual version "online".
So I've changed the kata slightly to include the group keys in the final output. Sorting of the returned value is also necessary by the user. Sorry @FArekkusu if I've modified your code. Didn't realize anyone was working on this.
this part isn't handled.FArekkusu's changes to the description were much better. You should take those (through the revision page... But that might be a pain to extract the data from there...)Thing is... he wasn't supposed to... x)
oh, you actually totally changed the requirements... Let's look at those, then
Well, it's almost worse than it was... ;)
[ tuple(key as tuple, list of aggregates), ...]
. The current ouput makes the key and the aggregated result indiscernible.EDIT: actually, the output
shouldcould just be a dict...Lol alright fair enough. I think @FArekkusu is right in the the return value should be a dict. I'll find his original description changes and modify that as well.
Hey dude, I believe everything is now in order.
seems so.
The user can modify the input.
Fixed.