Ad
  • 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
    expected: [{:average_salary=>99626.51, :job_title=>"fisherman", :total_people=>1, :total_salary=>99626.51}, {:a....52}, {:average_salary=>14386.49, :job_title=>"cashier", :total_people=>1, :total_salary=>14386.49}]
         got: [{:average_salary=>99626.51, :job_title=>"fisherman", :total_people=>1, :total_salary=>99626.51}, {:a...}, {:average_salary=>10266.25, :job_title=>"astronomer", :total_people=>1, :total_salary=>10266.25}]
    

    Average and total values are the same in this dataset, as every job has only 1 person. Sorting should be done descending by highest average salary.
    But the cashier is expected to be the last/ the one with the least salary of 14386.49, even though the astronomer is only receiving a measly salary of 10266.25.

  • 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

    Where there are multiple vowels in succession, you will see empty rows.

    So the intention is to produce no row for a single vowel, and one empty row for each successive consecutive vowel?

  • 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

    If I repeat the above "attempt" to log the data for Ryu until I get a dataset that has Ryu in the expected top 6, the expected result for Ryu is: 42 wins, 11 losses, and his fight records are:

    id	name	won	lost	move_id
    739	Ryu	2	0	7
    187	Ryu	1	0	7
    215	Ryu	2	0	6
    236	Ryu	1	0	4
    349	Ryu	1	0	8
    368	Ryu	2	0	7
    380	Ryu	1	0	7
    415	Ryu	2	0	8
    420	Ryu	2	0	8
    499	Ryu	2	0	7
    584	Ryu	2	0	4
    721	Ryu	2	0	6
    95	Ryu	1	0	6
    106	Ryu	1	0	8
    113	Ryu	1	0	8
    133	Ryu	2	0	8
    165	Ryu	2	0	8 
    --> 17 records with lost= 0 (7x won 1, 10X won 2)
    
    35	Ryu	2	1	6 
    59	Ryu	1	1	8
    319	Ryu	2	1	4
    690	Ryu	1	1	7
    510	Ryu	2	1	4
    534	Ryu	1	1	7
    33	Ryu	2	1	4
    688	Ryu	1	1	7
    476	Ryu	1	1	8
    493	Ryu	1	1	7
    290	Ryu	1	1	7
    11 records with lost= 1 (4x 2, 7x 1)
    

    --> Here, there are 17 records with lost= 0, but only 11 are actually expected. So now we would need to exclude 6 fight records with lost= 0.

    However, of those 17, 7 have won= 1, and 10 have won= 2, which does not leave any way to proceed other than assuming lost= 1 would possibly mark a LOSS (which the description has ruled out).

    #########################
    I would consider this an ISSUE, but I cannot edit the label here...

  • Custom User Avatar

    Logging the countable results of one fighter in an "Attempt" with:
    SELECT * FROM fighters WHERE name='Ryu' AND move_id> 3 ORDER BY lost;

    results in:

    id	name	won	lost	move_id
    649	Ryu	1	0	8
    106	Ryu	1	0	4
    179	Ryu	1	0	8
    187	Ryu	1	0	6
    447	Ryu	1	0	6
    462	Ryu	1	0	4
    569	Ryu	1	0	5
    570	Ryu	1	0	5
    10	Ryu	2	0	5
    297	Ryu	2	0	8
    485	Ryu	2	0	6
    628	Ryu	2	0	5
    558	Ryu	2	0	6
    240	Ryu	2	0	6  
    --> 14 records showing 0 in column "lost"
    
    225	Ryu	1	1	4 
    377	Ryu	1	1	4
    458	Ryu	1	1	4
    58	Ryu	1	1	7
    503	Ryu	1	1	4
    478	Ryu	2	1	4
    580	Ryu	2	1	7
    309	Ryu	2	1	6
    76	Ryu	2	1	7
    295	Ryu	2	1	6
    373	Ryu	2	1	5
    185	Ryu	2	1	8
    468	Ryu	2	1	8
    472	Ryu	2	1	5
    --> 14 records not showing 0 in column "lost" (5x won= 1, 9x won= 2) --> 18+5= 23
    

    The expected result for Ryu in this attempt is: Ryu wins: 43, Ryu lost: 14.

    From this we can assume that all lost= 0 recordings mark a LOSS, and that won= 2 is not a DRAW, but a WIN with special points that have to be accounted for in the query. But if so, how would we arrive at 43?

    As won= 1 has been declared as a regular win and lost= 0 seems to be counted as 1, it seems fair to think those five results with won= 1 should be counted as 1 each. That would mean the 9 won= 2 records had to be multiplied with some factor, but 43- 5= 38, and 38/ 9= 4,2222, which would be a bit odd. Are the data just broken here?

  • Custom User Avatar

    Understood, thank you!

  • Custom User Avatar

    even an empty function will result in no output. this is because console.assert() is disabled in the preloaded section (which is invisible to you until you solve the kata). many things are disabled or otherwise hijacked in this kata, i am not sure about why this method is disabled in particular.

  • Custom User Avatar

    Dunno why this is a spoiler...

  • Custom User Avatar

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

  • Custom User Avatar

    I did it in 628. Then I realized there were free letters from the get-go. DandDangDang!

  • Custom User Avatar

    So calling two separate where-filters is a logical AND, while combining two where-filters in one where-call is an OR?

    // SELECT studentName, teacherName FROM teachers, students WHERE teachers.teacherId = students.tutor AND tutor = 1
    query().select(student).from(teachers, students).where(teacherJoin).where(tutor1).execute(); //[{"studentName":"Michael","teacherName":"Peter"}] <- AND filter
    // SELECT * FROM number WHERE number < 3 OR number > 4
    query().select().from(numbers).where(lessThan3, greaterThan4).execute(); //[1, 2, 5, 7] <- OR filter

  • Loading more items...