Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 291 Bytes

779.md

File metadata and controls

23 lines (14 loc) · 291 Bytes

K-th Symbol in Grammar

Description

link


Solution

  • See Code

Code

class Solution:
    def kthGrammar(self, N: int, K: int) -> int:
        return bin(K - 1).count('1') & 1