New answers tagged

3 votes

Fastest way to generate {{a,a},{a,b},{a,c},{b,b},{b,c},{c,c}} from {a,b,c}

x = {a, b, c}; Union @ Map[Sort] @ Apply[Join] @ Outer[List, x, x] {{a, a}, {a, b}, {a, c}, {b, b}, {b, c}, {c, c}}
eldo's user avatar
  • 70.4k

Top 50 recent answers are included