我有以下数组:
[1 , 2]
[1 , 3]
[1 , 4]
[2 , 3]
[2 , 4]
[5 , 1]
我想打印如下输出:
"Items related to 1:"
2, 3, 4, 5 *note this last one was on the first column and 1 in the second
"Items related to 2:
3, 4
"Items related to 3:"
1, 2
"Items related to 4:"
1, 2
"Items related to 5:"
1
有任何想法吗?