Ad
  • Custom User Avatar

    It is unclear why in the described example "Annabelle Lee" is not included in the result, it has 1 record where the function returns the distance from 1 to 3

  • Custom User Avatar

    I can't complete as I'm getting this error: ./spec/query_spec.rb:169:in block in format_output': undefined method ljust' for nil:NilClass (NoMethodError)
    Any idea what is going on?

  • Custom User Avatar

    Tests do not require a final dot.

  • Custom User Avatar

    Expected values

    film_id	film_title	                            rental_count	    last_rental_date
    459	    Indiana Jones and the Last Crusade (R)    13	              December 12, 2024
    188	    Cinema Paradiso (G)	                   13	              December 01, 2024
    304	    The Shining (R)	                       13	              December 01, 2024
    295	    All About Eve (PG)	                    12	              November 11, 2024
    171	    The Kid (PG)	                          12	              December 12, 2024
    300	    The Great Dictator (PG)	               12	              December 09, 2024
    145	    The Help (PG-13)	                      12	              December 04, 2024
    

    2nd level sorting order is to be the rental date, so I think this should better be sorted be the actual dates, not the strings, otherwise Nov 11th will be shown as "later" than Dec 12th.

  • Custom User Avatar

    My solution is passing without accounting for leap years, and I think that is ok for a beginner level kata.
    If so, maybe you could change this date for the last sample test entry to 367?
    --> host_software.insert(host: 'backup_server_1', software_title: 'Title1', install_date: Date.today - 366)

  • Custom User Avatar

    You could add to the description that "percentage of orders" only refers to the count of processed orders here, not to the combined total orders.

  • Custom User Avatar

    Trying to make sense of what is expected in terms of sorting. This is what is expected (only showing two dates here):

    Results: Expected
    
    product_id	sale_qty	return_qty	date
    p1	        66	      9	         2023-08-19
    p1	        66	      6	         2023-08-19
    p1	        26	      9	         2023-08-19
    p1	        26	      6	         2023-08-19
    --> So for August 19th sorting should be descending for sales and descending for returns
    
    p1	        41	      5	         2023-08-31
    p1	        41	      22	        2023-08-31
    p1	        39	      5	         2023-08-31
    p1	        39	      22	        2023-08-31
    --> But for August 31st sorting is expected to be descending for sales and ascending for returns
    
  • Custom User Avatar

    I believe "returns no products if no tags are provided" should be stated in description as well. For me it is not a default behaviour (maybe it is a professional deformation, though)

  • 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

  • Loading more items...