6 kyu
"com", "gov", "org" first
146 of 418aspirin
Loading description...
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.
To solve this problem, you need to focus on two key aspects:
this is unintelligible.
Description should be spell checked and some specs just written better.
I don't do C#, so I didn't check (2) ( but thanks! ).
There are still some rather distracting spelling and word errors left in the description. At first glance: it's, till, missing indefinite articles.
Better, but not there yet.
Python fork resolving issue + suggestion by vl4deee11 here
approved by someone, thx
All languages should have sample and fixed tests added for case below:
http://www.google.govt/?x=jsdfkj
http://www.google.acom/?x=jsdfkj
etc...
Implemented as well in random tests for C#
Interesting kata, seriously, well done.
please specify which level the domain should play a key role in sorting when sorting " other domains"
Top Level Domain, like .by, .io, .dev, .funnitls, et cetera.
I think the description should include this info as well.
no,this is just bad.
For anyone else who comes across this Kata, and find the description confusing and missleading. Let me sum it up thusly.
Take all the URI's and sort them by the domain only, ensuring that "COM, GOV, ORG" are returned first, then the rest. Do not sort the actual URI, as this will change the order within the domains. Just sort on the domain.
Hope that helps someone...
Poorly written question, contradicts itself. It seems the author wants urls to be grouped by 'top level domain' (TLD), e.g. 'com', 'gov', etc. but he uses the word 'domain' which is misleading. Then at one point he says URIs should be listed in alphabetical order of domain, but then in additional rules he says ordering of domain not important. Also, it is not clear whether the remaining TLDs need to be in alphabetical order or not. e.g. should '.de' < '.en' or does it not matter?
This whole question can be explained very simply as follows:
Given a list of URIs, return a reordered list of URIs where the URIs are arranged according to their TLDs in the following order: all URIs with '.com', then all URIs with '.gov', then all URIs with '.org', followed by all other URIs. e.g. .com < .gov < .org < all other TLDs in any order
OR: Given a list of URIs, return a reordered list of URIs where the URIs are arranged according to their TLDs in the following order: all URIs with '.com', then all URIs with '.gov', then all URIs with '.org', followed by all other TLDs in alphabetical order. i.e. .com < .gov < .org < .de < .en etc
Python translation. Please, review and approve.
Already approved.
Random tests feedback is abyssmal. Can we get more feedback? The sample tests doesn't help either (there's only 1 example), and there's no specification as to what kind of url input will be presented.
Added more details for random test feedback such as the expected and actual lists of TLDs
Do not understand the rules, need or do not need to sort the coms, govs, orgs? Can you use a normal test method? I can't see what's happened... Just give me true or false, this is not the slightest help to me.
After my guess and test, that they do not need to sort(between "c.com","b.com","a.com"), Just in accordance with the original order. Only need to sort in accordance with the top-level domain name(such as .com/, .org/, etc..), Hope this will be helpful to the next guy.
Hi, thanks for comment, I've tried to explain it with "other part of Uri doesn't affect sorting." if you don't mind I'll add your example to kata desctiption. Not sure if I can change test because answers ("c.com","b.com","a.com") and ("b.com","c.com","a.com") are equal that's why I've marked kata as 7 kyu.
This comment has been hidden.
that is the point the result could be not unique. as I've mentioned before answers ("c.com","b.com","a.com") and ("b.com","c.com","a.com") are correct, but "c.com,b.com,a.com" != "b.com,c.com,a.com". But if it would be required to sort uris based on the left part, than it will be another (next) task, with higher difficulty
Great first kata! Thanks! Give us more of this stuff! :-)