4
When I combine for example 4 strings ["A","B","C","D"] 2 to 2, ie AB,AC,AD,BC... I can count on how many occurrences A and B appeared?
My problem involves 16 items that combined 4 to 4 generate 1820, but I would like to know how many of these 1820 items A and B, for example, appear together or isolated.
I already managed to generate the vector with combn and Combinations but I can’t count.
The combination is a vector product in which repeated letters are excluded from the final result. Then the solution is to create a vector from the square of the original vector (using a nested for loop, for example) and use a filter that eliminates repeated and has the letters of interest
– Lucas