Skip to content

Commit 4b67094

Browse files
authored
leetcode #779
1 parent 05e7a5d commit 4b67094

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

k-th-symbol-in-grammar.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
class Solution:
44
def kthGrammar(self, N: int, K: int) -> int:
55

6+
if N == 0 or N is None or K is None:
7+
return 0
8+
69
def backtrack(N,K):
710

8-
if N==1 and K == 1 :
11+
if N<=1 and K <= 1 :
912
return 0
1013

1114
size = 2**(N-2)

0 commit comments

Comments
 (0)