MCPcopy Create free account
hub / github.com/careercup/CtCI-6th-Edition-JavaScript / insertion.js

File insertion.js

chapter05/5.1 - Insertion/insertion.js:None–None  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1const insertion = (N, M, i, j) => {
2 const bitMask = (-1 << (j + 1)) | ((1 << i) - 1);
3 const clearedN = N & bitMask;
4 const shiftedM = M << i;

Callers

nothing calls this directly

Calls 1

insertionFunction · 0.85

Tested by

no test coverage detected