From: Ross Bamford Date: 2006-05-05T23:38:05+09:00 Subject: Re: [QUIZ] Bracket Packing (#78) On Fri, 2006-05-05 at 23:23 +0900, st103@doc.ic.ac.uk wrote: > Surely that isn't possible, some combinations could have more than one possible > correction, eg: > > [{BB] => [{B}B] > or > [{BB] => [{BB}] Either of the above is valid - the main object of this is just to make sure the packer doesn't get in a mess, and both of those will pass through fine (even if the wrappings aren't exactly as intended). > or even, > [{BB] => [{}BB] > or even, (tho presumably this is invalid - some sort of black hole packaging): > [{BB]} > Both of these are invalid, and definitely not what was intended - there won't be any empty packages (as in the first case) and the second isn't balanced. > Perhaps the program should present the possible options and ask which is wanted? If you want to output the options and fail with exitcode 1 for the ambiguous ones, that's cool too. -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk