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.
An O(N^2) time complexity algorithm will timeout, opt for an O(N) time complexity algorithm.
without diving too much, looks like there must be a shorter way to define the game result.
We can forget about 1-5 and 16-19 because they are inside 1-6 an 10-20. 1-6 and 5-11 = 1-11. And 1-11 and 10-20 = 1-20. It's length = 20-1 = 19;
This comment is hidden because it contains spoiler information about the solution
Hmm... I don't like this kata.
This comment is hidden because it contains spoiler information about the solution
You're right, everything overlaps, so you end with a unique interval
[1, 20]
, which length is19
.But you already used number 10 in the previous intervals (so, only 9 for those)
after looking on the instructions I don't get how this case should equal 19
which ones overlap each other here?
Clearly, [10, 20] and [16, 19] overlapping one another. So it gives, 10.
To me, all 3 others overlap each other so it's like [1, 11], which gives 10 as well.
As a result, shouldn't I get 20 here?
Skipping this one for now.
This comment is hidden because it contains spoiler information about the solution
The representation of a number as floating point or strings is exactly that: a representation. A string can exactly represent the input and output, so that's what's used. What you want to do with them is up to you.
You should add the numbers. That's it.
There's no ambiguity in the input or output. How you would implement it is your task.
Should I write a function to convert an output a sum of two numbers (which is 9.100232822049192e+28) to become a full number without a scientific notation? Is it a main idea? Or it is supposed to convert arguments firstly, i.e. to be displayed as an entire numbers without notation, and then sum up them?
yep, got it now, thx!
This comment is hidden because it contains spoiler information about the solution
Loading more items...