779. K-th Symbol in Grammar
Problem
We build a table of n rows (1-indexed). We start by writing 0 in the
- For example, for n = 3, the
row is 0, the row is 01, and the row is 0110.
Given two integer n and k, return the
Example 1:
Input: n = 1, k = 1
Output: 0
Explanation: row 1: 0
Example 2:
Input: n = 2, k = 1
Output: 0
Explanation:
row 1: 0
row 2: 01
Example 3:
Input: n = 2, k = 2
Output: 1
Explanation:
row 1: 0
row 2: 01
Constraints:
- 1 <= n <= 30
Code
按 <- 键看上一题!
777. Swap Adjacent in LR String
按 -> 键看下一题!
781. Rabbits in Forest