commit 6b5625fa8ea8aab3ef9f6b675f8a29fc8a275614
parent 095d05e82575e6b3345ab0819352b7d8576532de
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date: Sat, 9 Nov 2024 18:30:16 +0100
1 Random Problem
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Problems/3133.cpp b/Problems/3133.cpp
@@ -0,0 +1,13 @@
+class Solution {
+ public:
+ long long minEnd(int n, long long x) const {
+ using ull = unsigned long long;
+
+ for (ull i = 1, j = n - 1; j > 0 && i > 0;) {
+ if (!(x & i)) x |= j & 1 ? i : 0, j >>= 1;
+ i <<= 1;
+ }
+
+ return x;
+ }
+};
diff --git a/README.md b/README.md
@@ -1432,6 +1432,7 @@ reference and a base for solving problems.
| 3106 | Medium | [Lexicographically Smallest String After Operations With Constraint](Problems/3106.cpp) |
| 3110 | Easy | [Score of a String](Problems/3110.cpp) |
| 3111 | Medium | [Minimum Rectangles to Cover Points](Problems/3111.cpp) |
+| 3133 | Medium | [Minimum Array End](Problems/3133.cpp) |
| 3137 | Medium | [Minimum Number of Operations to Make Word K-Periodic](Problems/3137.cpp) |
| 3159 | Medium | [Find Occurrences of an Element in an Array](Problems/3159.cpp) |
| 3163 | Medium | [String Compression III](Problems/3163.cpp) |