Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
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?
Tests do not require a final dot.
Expected values
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.
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)
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.
Trying to make sense of what is expected in terms of sorting. This is what is expected (only showing two dates here):
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)
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."
This comment is hidden because it contains spoiler information about the solution
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()
This comment is hidden because it contains spoiler information about the solution
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)
My solution relies on the ISO 8601 week number and would return wrong results if:
1
to find the previous one, which would give0
, an invalid week number. (perhaps that one is impossible to catch)it should be mentionned that the sequence always starts from
1
Loading more items...