Daily Problem
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
@@ -0,0 +1,8 @@
class Solution {
public:
constexpr int kthGrammar(const int n, const int k) const {
if (n == 1) return 0;
const int mid = 1 << (n - 2);
return k > mid ? !kthGrammar(n - 1, k - mid) : kthGrammar(n - 1, k);
}
};
@@ -396,6 +396,7 @@
for solving problems.
| 0752 | Medium | [Open the Lock](Problems/0752.cpp) |
| 0763 | Medium | [Partition Labels](Problems/0763.cpp) |
| 0767 | Medium | [Reorganize String](Problems/0767.cpp) |
| 0779 | Medium | [K-th Symbol in Grammar](Problems/0779.cpp) |
| 0783 | Easy | [Minimum Distance Between BST Nodes](Problems/0783.cpp) |
| 0784 | Medium | [Letter Case Permutation](Problems/0784.cpp) |
| 0785 | Medium | [Is Graph Bipartite?](Problems/0785.cpp) |