Beta
The Intervals
Loading description...
Algorithms
Mathematics
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
According to the testcases duplicates in numbers should be treated as if they were different numbers. This should be explained in the kata's description or there should be no duplicate numbers allowed. Logically it makes no sense to analyse and write down intervals for same numbers more than once.
Some typo / minor grammar fixes in the description (ordered by appearance):
expectdexpected formatting ...intervakinterval are exclusive...inervalsinterval it belongs to...belongbelongs to the interval (1,4)...belongbelongs to the two last only, so the outputiwouldwould be: "4 ∈ (3;5) ∩ (2;9)"...handlehandled in the order of the list of intervals argument...withbyand
...It might also be better to mention that the number(s) that don't belong to any intervals are omitted from the output.
oh yes thanks
woops... x)
To be mathematically precise, intersection symbol should be used everywhere instead of union, as that's the correct logical choice here. By definition, if a number belongs to sets A and B, then it belongs to the intersection of A and B.
Conversely, if a number belongs to A, then it belongs to the union of A and any other set.
thanks, i am absolutely forgot about this symbol
Don't close issues until you handled them, thx. They are not here just for decorum, they have a meaning about the overall process your kata is involved in.
Cheers
btw:
what do you mean exactly?
oh i thought you were talking about the ability to somehow change the content of the tests and pass the kata with this, thanks i will keep that in mind when creating the kata
no, it's not that problematic... ;)
now 'from solution import the_intervals' is on the 39th line,and i hope this is the way you suggested
I'm still waiting for your answer so as not to close the problems until I figured them out
I didn't see your previous message, sorry. No, still not good. Use the following:
What about the description?
oh yeah thanks
I worked on the description and I think that there are no problems with it
I didn't realize before, but that part isn't logical. You're mixing union and intersection, there. The symbol is union. What you're talking about is intersection. => ? (you could talk about union everywhere => avoids the need to change the code, but then
(1;4) ⋃ (2;5) = (1;5)
. The actual problem is that the task has nothing to do with either union or instersection. You use the symbol just to express an "and" relation, actually. That's confusing / EDIT: btw, even f you replace with intersection, that mathematic relation isn't correct: intersection gives you another interval => that would be(1;4) inter (2;5) = (2;4)
).What array? And the example below aren't written in a way so that what you're talking about is obvious, while the user has absolutely no clue of what you're talking about. So instead (or something close to that):
input/ouput titles:
###
at the beginning of the lineEnd of input and ouput sections: there is a sentence after each code block starting with a
*
-> it looks like a foot note => remove the*
. For the output section, remove the parentheses as well (it's not a note, it's an actual spec!)Damn language barrier, k I used the Wikipedia link instead of any explanation and otherwise followed your advice
I updated the kata. Some notes for later use:
I rewrote the description. Hopefully it will be enough.
Holy thanks otherwise it could take more longer time, I will remember all this
Hi,
(a;b)
is used, so there is no point to talk about(...]
or any other variationit's not specified in the description in what order the strings should be built (order of the intervals) and ordered (in the overal output). Ok, it is... But why isn't that in theoutput
section? (=> "wrong order" ;) )Cheers
Yeah thanks i just dont completely understand how to edit tests from outside, and even more so how to deal with it, but in my opinion this kata still is not so hard to edit random tests instead solve them. I will think about this problem later
['(20;100)', '(10;110)', '(0:90)']
This test appears in 'fixed_not_so_simple_tests' tests. Notice the semicolons and 1 colon.
oh thanks again
['(8;149)', '(2;56)', '(3;100)', '(12;69)', '(2;85)', '(85;134)', '(28;118)', '(11;119)', '(11;105)', '(89;126)', '(7;40)', '(15;126)'] [94, 133, 42, 103, 65, 92, 118, 149, 6, 124]
'103 ∈ (62;106) ⋃ (58;127) and 40 ∈ (0;48) ⋃ (7;99) and 36 ∈ (0;48) ⋃ (7;99) and 125 ∈ (58;127)' should equal '103 ⋃ (62;106) ⋃ (58;127) and 40 ∈ (0;48) ⋃ (7;99) and 36 ∈ (0;48) ⋃ (7;99) and 136 and 125 ⋃ (58;127) and 133 '
I'm pretty sure the description says the formatting should be
n ∈ {interval}
, but the exepcted result in this test (and many more) has the formattingn ⋃ {interval}
yes this was really bullshit
['(45;90)', '(69;100)', '(12;70)'] [67, 255]
'67 ∈ (45;90) ⋃ (12;70)' should equal '67 ∈ (45;90) ⋃ (12;70) and 255 '
Also happens in random tests. Maybe I'm not understanding the kata.
thanks, I'll take the kata for revision
i finished revision