fix(posts): fetch daily from files

This commit is contained in:
Barrett Ruth 2024-11-29 22:13:16 -06:00
parent 3d2ee97afe
commit 2bcc3f4675
9 changed files with 691 additions and 0 deletions

View file

@ -0,0 +1,16 @@
long long minEnd(int n, long long x) {
int bits_to_distribute = n - 1;
long long mask = 1;
while (bits_to_distribute > 0) {
if ((x & mask) == 0) {
// if the bit should be set, set it-otherwise, leave it alone
if ((bits_to_distribute & 1) == 1)
x |= mask;
bits_to_distribute >>= 1;
}
mask <<= 1;
}
return x;
}