Skip to content

Instantly share code, notes, and snippets.

View alexbinary's full-sized avatar
💭
.

Alex Binary alexbinary

💭
.
  • Strasbourg, France
View GitHub Profile
@alexbinary
alexbinary / Combinatorics.swift
Created July 5, 2021 07:42
Get all possible combinations of the elements in a set
enum Combinatorics {
public static func combinations<T>(of set: Set<T>) -> Set<Set<T>> {
if set.count == 1 {
return Set<Set<T>>([set])
} else {