Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Tiwarishashwat/InterviewCodes
/ findKthBit
Method
findKthBit
FindKthBitInNthBinaryString.java:3–6 ·
view source on GitHub ↗
(int n, int k)
Source
from the content-addressed store, hash-verified
1
// findKthBit - recursion
2
class
Solution {
3
public
char findKthBit(
int
n,
int
k) {
4
int
len = (
int
)Math.pow(2,n) - 1;
5
return
recur(len,k);
6
}
7
public
char recur(
int
len,
int
k){
8
//base case
9
if
(len == 1){
Callers
nothing calls this directly
Calls
1
recur
Method · 0.95
Tested by
no test coverage detected