Skip to content

Commit

Permalink
Re2: Day 14
Browse files Browse the repository at this point in the history
  • Loading branch information
kzlsakal committed Dec 14, 2020
1 parent ba6756f commit 75e6aa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion challenges/2020/14.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const getFloating = (key) => {

while (xCount) {
const currentNums = [];
const xIdx = nums[0].indexOf('X');

for (let num of nums) {
const xIdx = num.indexOf('X');
const lower = num.slice(0, xIdx).concat('0', num.slice(xIdx + 1));
const upper = num.slice(0, xIdx).concat('1', num.slice(xIdx + 1));
currentNums.push(lower, upper);
Expand Down

0 comments on commit 75e6aa9

Please sign in to comment.