We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4209275 commit 7fddfa9Copy full SHA for 7fddfa9
day5/program.js
@@ -12,7 +12,7 @@ function extractStacks(data) {
12
}
13
14
const containerRows = [];
15
- // use a while loop to loop through data until a row has a 1 on position 2 in the string
+
16
let i = 0;
17
while (i < data.length) {
18
if (data[i][1] === '1') {
@@ -28,10 +28,8 @@ function extractStacks(data) {
28
parts.forEach((part, i) => {
29
if (part === '') return pos++;
30
if (part.substr(0,1) === '[') pos += 4;
31
- console.log(pos, part);
32
const stackNum = pos/4-1;
33
stacks[stackNum].unshift(part);
34
});
35
36
- console.log(stacks);
37
0 commit comments