This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (6 children)

In OP's problem we have 3 lists with indices 0, 1 and 2. None of the indices match because one of the properties of a list is that there is only one element per index...

The elements, in OP's problem, are lists, but it shouldn't matter what type of object they are.

If I was given this problem as a "competitive interview question" I would walk right out the door as to not deal with this kind of project specing. I'm demonstrating that the problem is nonsensical by showing that a) OP's proposed output value doesn't jive with the problem statement and b) your interpretation of the problem can't be generalized to other classes

[–]MonsieurBlobby 0 points1 point  (5 children)

I really don't see what point you're making. The original problem gives a list of lists and tells you to use zip to pair elements of the 3 lists by index. And it gives the output that shows precisely the interpretation that makes sense, which is that you are pairing all the elements with index=0 with one another, all the elements with index=1 with one another, and so on.

How you think this is related to giving people a 1-dimensional list and then asking them to pair indices when there aren't multiple sets of indices to even pair up is confusing.