3 ms·
I think a more flexible way might be to shuffle the boxes, placing each box into a ring data structure, and placing each apple into the next box. As we'd expec
by fleitz 17y ago
I think a more flexible way might be to shuffle the boxes, placing each box into a ring data structure, and placing each apple into the next box.
As we'd expect each box to contain more than one apple this should reduce shuffling.
But yeah, I agree, they always want code not how it might work.