Ad
  • Custom User Avatar

    While the emphasis is on the uniqueness of the features rather than their order, the final tests require that the features maintain their original order. It might be helpful to clarify: "Although order is not a factor when determining uniqueness, the final output should present the arrays in their original order."

  • Custom User Avatar

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

  • Custom User Avatar

    Results [..] should be ordered by product_id (asc) and then by the sequence of the letters as they appear in the features string for each product.

    Is the second criterion actually enforced ? Or even enforceable ? My own solution does not explicitely take care of it, I'm not sure whether it's because PostgresSQL produces a stable sort as an implementation detail (since the SQL standard does not make such a guarantee) or whether it's a consequence of using regexp_split_to_table()

  • Custom User Avatar

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

  • Custom User Avatar

    I am currently working on this kata on sunday, and I’m encountering some issues with the tests. The "results: expected" field appears blank in the sample test suite, as well as in the random tests within the full test suite. For the edge case test, there are two valid entries for sale_date with dates "2024-10-19" and "2024-10-20." However, in the sample tests, sale_date values fall between "2024-10-21" and "2024-10-30," and in the random tests, they range from "2024-10-21" to "2024-11-04."
    (Edit: I tried it again with the exact same solution on the following day and it passed with flying colours, so there is something wrong with the tests on sunday)

  • Custom User Avatar

    My solution relies on the ISO 8601 week number and would return wrong results if:

    • the tests included sales made in previous years during the week that shared the same week number as the last week
    • the current week is the week number 1 of the year, as I decrement by 1 to find the previous one, which would give 0, an invalid week number. (perhaps that one is impossible to catch)
  • Custom User Avatar

    it should be mentionned that the sequence always starts from 1

  • Custom User Avatar

    In the random tests, there are duplicate features in the special_features column; features array such as {"Deleted Scenes","Deleted Scenes",Trailers} are apparently expected to be rejected.

    the description only says:

    returns only the films that have only "Trailers" and "Deleted Scenes" as their special features

    which does not make it obvious how duplicate entries should be handled - i would expect duplicate entries to be idempotent. Perhaps this should be clarified ?

  • Custom User Avatar

    Notes says:

    It is not possible for more units of a certain product to be sold than purchased at any given moment in time because the FIFO Gross Margin calculation assumes that sales are matched to prior purchases.

    but in example tests I see

    edge_case_purchase_data = [
      # sales exceeding purchases: only 2 units purchased, but 3 units sold
      {sku: 'exceed_001', purchase_date: '2023-01-01 10:00', price: 10.00, qty: 2},
    ...
    edge_case_sales_data = [
      # sales exceeding purchases: 3 units sold, but only 2 units purchased
      {sku: 'exceed_001', sale_date: '2023-01-05 10:00', price: 20.00, qty: 3},
    

    it looks like a contradiction to me. So from the description the result for this sku is unclear (could be 20, 30 or even 40)

  • Custom User Avatar

    purchase / sales - naming is inconsistent: singular/plural

    I'd suggest 'purchases'

  • Custom User Avatar

    Something is wrong with the test cases, I even recreated some of the accepted queries and it throws up a failed attempt after passing the initial Test.

  • Custom User Avatar

    I've got a solution that handles every part of the problem except the (if a customer ever rented an NC-17 movie). I can filter out all NC-17 movies from the total count, but am failing to think of a way to completely remove these customers without using a CTE or subquery. A hint would be appreciated.

  • Custom User Avatar

    The example in the description is not entirely successful, it would be better to add one non-day off and one day off that does not relate to the 23rd year

  • Custom User Avatar

    The first bulleted condition doesn't make sense to me. Some examples are needed to clarify. Not really sure how to go about solving this until that's fixed.

    It also doesn't make sense that some of the rental_dates occur after 8/1/2005, when supposedly for the context of the problem today is 8/1/2005. How can a customer have rented a video in the future?

  • Custom User Avatar

    I found that depending on your solution, submitting multiple times can change whether or not you pass the test.

  • Loading more items...