0
How to compare all the elements of a list with each other?
How to compare all the elements of a list with each other?
9 ответов
+ 1
Марсель Халимов None represents default value, comp means any comparison based on a[i] and a[j].
+ 1
I deleted that invalid junk.
+ 1
It creates a 2D list:
-1 + + + +
...
2 + + + +
1 + + + +
0 + + + +
0 1 2 ... -1
Which is filled with results of a's values operated with each others.
+ 1
Here I created multable, but the operation and list can be changed to any.
https://code.sololearn.com/cniZbx4nYXWS/?ref=app
+ 1
Марсель Халимов (None is left when item is compared with itself), but here:
https://code.sololearn.com/ceSiOb6byVJC/?ref=app
0
What does mean None and comp in your code
0
And I should compare all the elements and find out how many similar items are there
0
So how it is does
0
find out how many similar items are there