JAlgoArena
JAlgoArena copied to clipboard
"Chocolate Bars" - specification slightly underdefined
We are given a picture of example bars, and the cuts that lead to the preferred solution -- this is good. However, in order to code it, we'd like to get some info on how each bar is encoded in the int[][];
- can we assume these matrices are rectangular?, or
- could we please get the matrices that correspond to the two bars from the example? is, for instance the lower one,
[1][1][1]
[1]
[1][1][1]
given by {{1,1,1},{0,0,1},{1,1,1}? (Are empty places encoded by
0
or other char?)
- No, that's not correct assumption, after cut they may have different lengths (arrays in array)
- [[[1],[1,1,1],[1]],[[1,1,1],[1],[1,1,1]]]
ah -- OK -- now I see -- so these pieces come from one bar cut somehow; and the input for the first is "left justified" (so to say) and 2nd is "right justified" -- is it correct ?
(for we would have ambiguities if the two pieces were cut in a "w", "m" way... ) (I just want to understand the input data correctly)