7 kyu
Coding Meetup #17 - Higher-Order Functions Series - Sort by programming language
620 of 2,153PiotrBerebecki
Loading description...
Functional Programming
Data Structures
Arrays
Fundamentals
Algorithms
Sorting
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.
After solving all 17 problems, I must say it was enjoyable, interesting, and straightforward. Thank you so much!
Piotr, I just finished all of your coding meet up katas that are available in Python. I was looking to improve my skills with dictionaries and list comprehensions and this was a fantastic set of problems, all very well described and thought out.
Thank you for your work! I will definitely revisit for JavaScript.
the debugging is extremely tedious. good kata tho
python new test framework is required. updated in this fork
Approved
Thank you very much for this series! With this occasion, I polished my JavaScript skills and I think I am ready to approach more difficult katas. Greeeeeeat lesson! :D
This comment has been hidden.
paste it in your solution
https://pastebin.com/uqdnQqe0
I don't think your code is right, you're sorting the list by one criteria and then sorting it again by another, that's not what you should be doing.
Thank you for series! Had fun time solving it:)
Ruby 3.0 should be enabled.
Enabled in this fork
Thank you so much, that was a really fun series! Straightforward but useful!
If you had these in a collection, it would be nice.
In Ruby version:
firstName
as key while test cases usefirst_name
. Potentially confusing.var
in description.Description and examples fixed, thanks :)
[Let me know if I forgot anything]
Your examples in the "input" section appear to be from the JavasScript version of this kata (given the use of
var
) and would lead someone to believe you are using symbols as your keys. For example:{ firstName: 'Nikau', lastName: 'R.', country: 'New Zealand', continent: 'Oceania', age: 39, language: 'Ruby' }
In case you are not familiar with this style of litereal hash formatting, this is the same as:
{ :firstName => 'Nikau', :lastName => 'R.', :country => 'New Zealand', :continent => 'Oceania', :age => 39, :language => 'Ruby' }
However your test cases use
String
keys and snake case for the keys. Example:{ "first_name" => "Nikau", "last_name" => 'R.', "country" => "New Zealand", "continent" => "Oceania", "age" => 39, "language" => "Ruby" }
If you were not intending on having the kata practice handling both
Symbol
andString
keys (as well as the different cases) then you should update the input to follow the expected keys. The description says that the test cases will follow exactly the form shown.Indeed, thanks for pointing this out, Gavin. Basically, as of the time of writing of this comment, the format presented for Ruby is as specified by Gavin:
{ "first_name" => "Nikau", "last_name" => 'R.', "country" => "New Zealand", "continent" => "Oceania", "age" => 39, "language" => "Ruby" }
Description updated, let me know if I forgot anything else.
keys are shown as symbols in the instuctions but are string in the ruby solution.
They do not look at all as symbols to me, as symbols are with a leading, not trailing colon.
Python, Ruby and Crystal translations kumited.
Minor typo: Piotr's language is set to
Javascript
instead ofJavaScript
.Wow!, thanks for catching this. Fixed.