Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @DavidAugustoVilla,validated by @Timinator,@pluieciel,@yhuberla and @TBali.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @DavidAugustoVilla,validated by @Timinator,@pluieciel,@yhuberla and @TBali.
If you have any issues, feel free to ping them.
Can someone clarify exactly what is meant by “solid” and “bulk” volume? Having looked up the definitions of these terms, this is how I’m interpreting them:
Solid volume refers to the total volume of solid material – in other words, the total number of ‘#’ characters in the shape (since each “bead” or ‘#’ character would have a volume of 111=1).
Bulk volume refers to the total volume of the shape including the space between beads. I’ve interpreted this as follows: for each 2D (x,y) coordinate, scan through the z values and find the minimum and maximum z values (low and high respectively) for which shape[x][y][z] == ‘#’, then add (high-low+1) to the total bulk volume.
This produces correct results for about half of the tests, and I can’t seem to figure out what differentiates the tests that I’m getting right and the ones I’m getting wrong. One test that I’m particularly confused by is 05. Critical flaw. According to my interpretation the values should be:
Solid volume = 247 (the total count of ‘#’ characters)
Bulk volume = 343 (it’s a 7x7x7 box, so the total volume from one end to the other including space would simply be 777)
…but according to the expected output, these values should be equal (solid/bulk = 1.000). I’m clearly misunderstanding something very significant here, because I can’t for the life of me understand how that could be possible.
Thanks!
It seems your interpretation of Bulk vol is largely correct but the way you try to get the bulk vol is not.
In test case 05, the object is like an empty bottle without a locking cap. The object is not sealed. Air or liquid can go through a hole into the internal space inside the object. In that sense, the internal space is not sealed space and thus should not be counted into bulk vol.
Excellent, your explanation has made perfectly clear where I went wrong. I’m getting the proper outputs now. Thank you!
I think in general all of the different metrics should be better defined.
For example, I’m not clear about “external surface”, if we have something like this
#####
#ooo#
#oooo
#ooo#
#####
External surface is only the area around the box, or we need to calculate also the area of the cavity, as it is connected with outside?
This makes a good point, “exterior” is a misnomer. It should state the active surface in contact with the medium. (In your example this includes the cavity.) So only exclude interior surface area inside a sealed void. Let me think about how to reword that.