Skip to content

Commit

Permalink
🔨 killl-thBit solved
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelDarco committed Mar 16, 2024
1 parent bad630a commit 557a70f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions intro_challenges/KillK-thBit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function solution(n: number, k: number) {
return n & ~(1 << (k - 1));
}

console.log(solution(37, 3)); // Output 33

console.log(solution(2147483647, 16)); // Output 2147450879

0 comments on commit 557a70f

Please sign in to comment.