summaryrefslogtreecommitdiff
path: root/content/string/deBruijn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'content/string/deBruijn.cpp')
-rw-r--r--content/string/deBruijn.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/string/deBruijn.cpp b/content/string/deBruijn.cpp
new file mode 100644
index 0000000..e829137
--- /dev/null
+++ b/content/string/deBruijn.cpp
@@ -0,0 +1,7 @@
+string deBruijn(int n, char mi = '0', char ma = '1') {
+ string res, c(1, mi);
+ do {
+ if (n % sz(c) == 0) res += c;
+ } while(next(c, n, mi, ma));
+ return res;
+}