|
@@ -12,16 +12,18 @@ async function main() {
|
|
let info2 = info[0].split('-')
|
|
let info2 = info[0].split('-')
|
|
let stringSplit = element[1].split('')
|
|
let stringSplit = element[1].split('')
|
|
|
|
|
|
- if (stringSplit[info2[0]] === info[1]) {
|
|
|
|
- if (stringSplit[info2[1]] === info[1]) {
|
|
|
|
- console.log('correct')
|
|
|
|
- } else {
|
|
|
|
- invalid.push(element)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (stringSplit[info2[0]] === info[1] && stringSplit[info2[1]] === info[1]) {
|
|
invalid.push(element)
|
|
invalid.push(element)
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ } 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)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
let answer = data.length - invalid.length
|
|
let answer = data.length - invalid.length
|
|
console.log(answer)
|
|
console.log(answer)
|