Public
Edited
Dec 31, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
input = "3".repeat(70)
Insert cell
function editor(input) {
let str = input;
while (/333|77777/g.test(str)) {
if (/333/g.test(str)) {
str = str.replace(/333/, "77");
} else {
str = str.replace(/77777/, "7");
}
}
return str;
}
Insert cell
editor(input)
.split("")
.map(Number)
.reduce(function (a, b) {
return a + b;
}, 0)
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more