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.
Weights can be zero, because diamonds exist. Prices can also be zero, because bricks exist.
If Python does not have ( fixed ) tests with zero weights and / or zero prices, these can ( and should ) be added.
theres like two main approaches taken to this problem, but some just way overcomplicate the solution.
hint. read about c++ streams
The difference would be 2 in either case.
does up and down climbs count equal weight of difference
if starting from 9 -> 8 -> 7 differences would be still = 3 between these?
is it the same as going from 7->8->7 differences would still be 3?
pro (or noob) tips for C++
That's because some items can have a weight of 0 (which is nonsensical), and the solution only checks up to 0 (not inclusive). Change
for w in range(n, 0, -1):
tofor w in range(n, -1, -1):
and it will work.Also
n
can be 0 too. This should be fixed or at least mentioned in the description.The table name you should use is
people
, you only need to return a single column,age_sum
. That is already in the kata's description, read it again. If you have to sum them all, then the result is a single row.+1
In particular, since this is supposed to be a beginner kata.
So far, I haven't solved this kata, as the instructions need much more clarification.
What is the table name? Which columns are expected to be returned, or just one row?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
very clean version using the generic programming! would not have thought this up myself very easily.
OP solved it, closing
OP solved it, closing
OP solved it, closing
OP solved it, closing
Loading more items...