Skip to content

Commit

Permalink
Re: Day 14 fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kzlsakal committed Dec 14, 2020
1 parent 75e6aa9 commit 2117191
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions challenges/2020/14.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const getKeyVal = (cmd) => {
return [key.slice(4, -1), val];
};

const unmaskBits = (cmd, mask, maskIdx, skipedChar) => {
const unmaskBits = (cmd, mask, maskIdx, skippedChar) => {
const keyVal = getKeyVal(cmd);
keyVal[maskIdx] = Number(keyVal[maskIdx])
.toString(2)
.padStart(36, '0')
.split('');

for (let i = mask.length - 1; i >= 0; i--) {
if (mask[i] !== skipedChar) {
if (mask[i] !== skippedChar) {
keyVal[maskIdx][i] = mask[i];
}
}
Expand Down

0 comments on commit 2117191

Please sign in to comment.