Browse Source

fixed and working

karl.hudgell 4 years ago
parent
commit
2583cf67c0
1 changed files with 4 additions and 9 deletions
  1. 4 9
      Day 2/part2.js

+ 4 - 9
Day 2/part2.js

@@ -17,16 +17,11 @@ async function main() {
         } else
             if (stringSplit[info2[0]] !== info[1] && stringSplit[info2[1]] !== info[1]) {
                 invalid.push(element)
-            } else
-                if (stringSplit[info2[0]] !== info[1]) {
-                    invalid.push(element)
-                } else
-                    if (stringSplit[info2[0]] !== info[1] && stringSplit[info2[1]] === info[1]) {
-                        invalid.push(element)
-                    }
+            } else {
+                console.log(element)
+            }
     }
     let answer = data.length - invalid.length
-    console.log(answer)
+    console.log('Valid ' + answer)
 }
-
 main()