Your solution fails, i.e. it returns false, for
items = [1,2,2]
row = [1,2]
rows = [ row, row, [1,3]]
Hmm, I wonder if I can get away with it by being pedantic about the wording of the
But this doesn't work:
a-of-as: [ [1,2,3,4], [5,6,7,8] ]
because the 1 and the 2 both get placed in the same array; it’s
a many-to-one correspondence.
In your example, the 1 and the 2 get “placed in the same array”. The array just appears
more than once. Or does it have to be a capitalized “Array” for this argument to hold?
Oh well, if it’s not acceptable, then:
(115 chars — replace newlines with spaces.)