6 kyu

"com", "gov", "org" first

146 of 418aspirin
Description
Loading description...
Fundamentals
Algorithms
Sorting
  • Please sign in or sign up to leave a comment.
  • taher_el_mehdi Avatar

    To solve this problem, you need to focus on two key aspects:

    1. Extracting the TLD from a URL
    2. Sorting by Priority
  • custom_concern Avatar

    this is unintelligible.

  • JohanWiltink Avatar

    Description should be spell checked and some specs just written better.

  • 4500zenja1 Avatar

    Python fork resolving issue + suggestion by vl4deee11 here

  • ejini战神 Avatar

    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...

  • ahmet_popaj Avatar

    Interesting kata, seriously, well done.

  • vl4deee11 Avatar

    please specify which level the domain should play a key role in sorting when sorting " other domains"

  • bluiisdave Avatar

    no,this is just bad.

  • CodingDirk Avatar

    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...

  • nikhil5026 Avatar

    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

  • FArekkusu Avatar

    Python translation. Please, review and approve.

  • Voile Avatar
    RandomTests  
    
    Expected: True
    But was:  False
    

    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.

  • myjinxin2015 Avatar

    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.

  • user5036852 Avatar

    Great first kata! Thanks! Give us more of this stuff! :-)