-4
1
You are given an array of strings , you have to construct a single array containing all of them so that the same array of strings can be reconstructed from the large array. The strings may contain any ASCII character. How to determine length of the single large array?
Example= let a = ["asd";"dfg";"rew"]
. Problem is to combine them in a single string in such a way that it can reconstructed. How to figure out the size of the string which will store the concatenation ?
Why is it even an array? Shouldn’t the result just be one string? – Ry- – 2013-07-06T20:59:45.920
Simple - since ASCII is only 7 bits you can just use a value > 127 as a separator character between strings and some other value > 127 as a final terminator. – Paul R – 2013-07-06T21:17:55.090
What are you actually asking for? A program? A mathematical expression of the output size as a function of input size? (The latter would seem to be ill-defined, because there are an infinite number of injections from arrays of strings to strings). – Peter Taylor – 2013-07-06T21:50:34.700