EPIJudge
EPIJudge copied to clipboard
Draw the skyline problem incorrect test case
The input to first test case contains the array [10, 85, 84]
The expected result contains: .....[17, 24, 98], [25, 29, 84]....
It shows 24 - 25 as disjoint when it should have been [24, 25, 84] (or merged with other intervals)
There is no problem here since the interval is inclusive. [17, 24, 98] means the skyline from 17.0 to 24.9999 are in height 98. You could take a look of solution to understand why this works as well.
@tsunghsienlee Doesn't inclusive interval [17, 24] mean 17.0000 -> 24.0000 ?
I think the inclusive probably is not the best wording here. You could think each coordinate (i.e., 17, 24) is a single unit (look at the bar in the picture). So the interval between 17 and 18 does not matter. That is the reason the result is in this way. I think the problem description might need more example on explaining this.
I see so the output expectation is different. It would be really helpful if an example input/output is provided in question text. Because in merging intervals problem earlier the expectation of output is very different (similar to how I interpreted for this question), so it may not be easily evident.
Hi @zorro786 ,
After examining this more, I think the output format definitely needs improvements and there are bugs in the corner cases that it will be released in the next release. Thanks for bring this up and catch our attention.