NeetCode #872LC-1545MediumBit Manipulation
← Back to All Problems#872 · #1545 · Find Kth Bit in Nth Binary String(找出第 N 个二进制字符串中的第 K 位)
📌 Problem Statement & Constraints
The binary string
S_1 is 0, and for n > 1 the string S_n is S_{n-1} followed by 1 followed by the reverse of the bit-inverted S_{n-1}. Given n and k, return the k-th bit (1-indexed) of S_n. Constraints: 1 <= n <= 20, 1 <= k <= 2^n - 1.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!