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FFFBBFBRRL",
"BFBBFFBLRL",
"FFBBFBBLLR",
"BFFFBFFLLR",
"BBFFBFBLRL",
"FBBBBFBRLL",
"FBBFBFBLLR",
"FFBFFFBLRL",
"FFBBFBBRRL",
"BBFFFFBRLR",
"FBFBFFBLLL",
"BFFBFFFLRR",
"BFBFBFFLLR",
"FFBFBFBLRL",
"BBFFFBBRRR",
"FBFBFBBLLR",
"FBFFBFBRLR",
"FBFFBBBRRR",
"FBBBFFBLLL",
"BBFBBBBRLL",
"FBBBFFFLRL",
"FFFBBFFRLR",
"BFBFFFBRRR",
"BFFBBFBRLL",
"FBBFFFFRLL"];
let max = 0;
for (let row of rows) {
let value = 0;
let x = 512;
for (let char of row) {
if (char == 'B' || char == 'R') {
value += x;
}
x /= 2;
}
if (value > max) {
max = value;
}
}
console.log(max);
let seats = [];
for (let row of rows) {
let value = 0;
let x = 512;
for (let char of row) {
if (char == 'B' || char == 'R') {
value += x;
}
x /= 2;
}
seats.push(value);
}
seats = seats.sort();
for (let i = 0; i < seats.length; ++i) {
if (seats[i] == seats[i + 1] - 2) {
console.log(seats[i] + 1);
break;
}
}