Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User 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