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.
No chromosome is written like this, X comes first then Y.
Alternatively you can just include an index in the table and limit the recursion with "where index <= 90"
if the condition to check will be "YX" , i think this solution wouldnt work ..
Traceback (most recent call last):
File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper
func()
File "/workspace/default/tests.py", line 8, in basic_tests
test.assert_equals(chromosome_check('YX'), 'Congratulations! You're going to have a son.')
File "/workspace/default/solution.py", line 4, in chromosome_check
return "Congratulations! You're going to have a {}.".format(gender[sperm])
KeyError: 'YX'
It's a thing that only works for simple queries.
The docs says:
https://www.postgresql.org/docs/13/queries-with.html
Yes, this is wrong according to the program specification—that's not being slightly picky at all! It's a common error class that you need to watch out for because it can have real consequences, for example if you set about building a fence and find yourself one post short:
https://en.wikipedia.org/wiki/Off-by-one_error
Could someone explain to me how this works in steps??? thank you so much!
The randomised test data can produce inputs with multiple periods with equal visit counts. This proposed solution should include
v1.entry_time asc
in the order by to pick the earlier event in that case.Without the order by it is liable to pick the later group, and that's the wrong answer here (as
when_happened
should be the earliest timestamp).This is now failing some test cases?
int / int = int
5 / 4 = 1, not 1.250000
This comment is hidden because it contains spoiler information about the solution
Im felling very dumby
R maintains the
letters
vector, so no need to write out entire alphabet.I like how concise this is, but I'm not sure an order by col index is a best practice. Not that I don't also use it, but that's mostly when I'm in an RDBMS that won't let me reference a derived field by its alias. PostGres does allow it (ie: order by batting_average desc).
I need to get more accustomed to the ::casting operators in postgres. Oracle and SQLServer don't have them.