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.
See in the Kotlin Coding conventions (V2.0.21) the sections functions:
A memory leak occurs when no mine has been found.
Looking back, I can't say why the code was accepted at the time. I tried this code today, now the code is too slow. maybe the tests were changed.
generate_series
looks like a table name but it is not the name of a table.generate_series
is a PostgreSQL function. See the free PostgreSQL manual section 9.25. Set Returning FunctionsIn this case the call
generate_series(1,$1)
returns a table with one column and the rows 1, 2, 3 ... up to the value $1.The column as named i with
AS i
. The field i is used inside theSELECT
section to create the values as defined in the kata.I had the same message. The cause was a NULL value in one row. A string is required in each row. (In the output, you can't see the difference between an empty string and a NULL value.)
This comment is hidden because it contains spoiler information about the solution
I try to determine the difficulty level based on the description I can read under the kyu setting after selecting the kyu.
From my perspective, a 4 kyu kata with "... Computer science concepts using complex algorithms ..." is difficult to build with SQL. The internal implementation of the database is far above the levels of a kata. But, to me, within the "pure" data query language SQL a programming of "complex algorithms" is quite impossible, because SQL was designed to hide the complexity of the data search process from the user. Maybe a kata needed the usage of the PL/pgSQL language can reach level 4 kyu or above.
For me, a kata that can be solved in a dozen lines of SQL is in the range up to 5 kyu. Because the data manipulation/query langauge SQL is not designed as a tool to allow the implementation of complex algorithms.
For me, this kata is in the 7 kyu range because the description "... Iterating arrays and returning a subset of values ... " fits well to the content of the kata. The level 6 kyu could be also an option "... Complex language features (closures, scopes, monads, etc) ..." which could correspond to SQL array functions.
Thank you very much for the interesting katas. They help me very well to learn more about SQL. Your work creating new katas support me very well in my learning process.
There is a typo in the description:
We have a tabke named ...
This comment is hidden because it contains spoiler information about the solution
Thank you. Now it works as expected.
I am not sure what to write in the product_summary text.
Product 1: N times || Product 2: N times
should the same number N be used for both products?In the example and in the test reference data, the two numbers N in all rows are always the same.
Based on the description, I expected the first N to be the number of orders for product 1 and the second N to be the number of orders for product 2.
Thank you. A very good explanation. Now I understand the cause of my error.
My code fails in the "Advanced tests" section. I can't find the values which are correct.
5 years ago the discussion with user challisa shows similar issues. But the values discussed there are the values my function returns.
I added a print function at the end of my function:
The output of the Advanced tests are:
and
In both cases the printed value inside my function and the printed expected result does match but the test fails.
Can someone give me a hint? What are the correct return values to pass this two test cases?
Converting all integers to strings and converting them back to integers does not seem to me to be the best practice for this kata.
This comment is hidden because it contains spoiler information about the solution
Loading more items...