Working on a pretty interesting YouTube video

Apr 4, 2026 · 5:57 PM UTC

4
0
17
2,380
RepliesRelevant
Replying to @code_report
@code_report One of your C++ one partitions into 1111000 and then rotates the whole thing into 1110001.

Don't you only need to swap the last 1 and the last 0?
1
0
2
405
Replying to @BarryRevzin
@BarryRevzin Yes 👍
0
0
0
144
Replying to @code_report
1
0
0
151
Replying to @code_report
@code_report C++ count+construct can be optimized to avoid 3 extra allocations in the current version.

string out;
out.reserve(in.length())
out.resize(n-1, '1');
out.resize(in.length() - 1, '0');
out.push_back('1');
1
0
2
266
Replying to @code_report
@code_report Found a bug in CBQN from thinking '0'+1e4⥊1‿0 shouldn't be as slow as it was! So on latest develop ('0'+1⌽·∨'1'⊸=) is a concise-ish fast option utilizing bitarrs (("01"⊏˜1⌽·∨'1'⊸=) about as fast for without the fix); still a bit slower than the fully-manual one though.
1
0
1
165