I3IUWAWDYM3GYQ636JURRPXBEX2T6IHDDSFXUZDTCBOONJXHX4DAC
let questions = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
let len = 26;
for (let person of group) {
let questions2 = [];
for (let q of person) {
if (!questions2.includes(q)) {
questions2.push(q);
}
}
for (let i = 0; i < questions.length; ++i) {
if (questions[i] == null) {
continue;
}
let q = questions[i];
if (!questions2.includes(q)) {
questions[i] = null;
--len;
}
for (let q of group[0]) {
if (group.every(person => person.includes(q))) {
++result;
let trees = 0;
for (let i in input) {
let row = input[i];
let cell = row[(i * 3) % row.length];
if (cell == '#') {
trees++;
function count(x, y) {
let trees = 0;
for (let i in input) {
if (i % y != 0) {
continue;
}
let row = input[i];
let cell = row[(i / y * x) % row.length];
if (cell == '#') {
trees++;
}
trees = 0;
for (let i in input) {
let row = input[i];
let cell = row[i % row.length];
if (cell == '#') {
trees++;
}
}
treeCounts.push(trees);
trees = 0;
for (let i in input) {
let row = input[i];
let cell = row[(i * 3) % row.length];
if (cell == '#') {
trees++;
}
}
treeCounts.push(trees);
trees = 0;
for (let i in input) {
let row = input[i];
let cell = row[(i * 5) % row.length];
if (cell == '#') {
trees++;
}
}
treeCounts.push(trees);
trees = 0;
for (let i in input) {
let row = input[i];
let cell = row[(i * 7) % row.length];
if (cell == '#') {
trees++;
}
}
treeCounts.push(trees);
trees = 0;
for (let i in input) {
if (i % 2 == 1) {
continue;
}
let row = input[i];
let cell = row[(i / 2) % row.length];
if (cell == '#') {
trees++;
}
}
treeCounts.push(trees);
console.log(treeCounts.reduce((acc, cur) => acc * cur, 1));
treeCounts.push(count(1, 1));
treeCounts.push(count(3, 1));
treeCounts.push(count(5, 1));
treeCounts.push(count(7, 1));
treeCounts.push(count(1, 2));
console.log([
count(1, 1),
count(3, 1),
count(5, 1),
count(7, 1),
count(1, 2)].reduce((acc, cur) => acc * cur, 1));