Public
Edited
Aug 8, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
algo_ays = (l, r) => {
let diff = Math.abs(l-r);
let new_d;
if(diff == 0){
new_d = l-1;
} else {
new_d = diff;
if(l>1 & r>1){
let small = Math.min(l,r);
let big = Math.max(l,r);
let mod = big % small;
if(mod == 0){ new_d = small +1;}
else{ new_d = small + mod;}
}
}
return new_d;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
get_pi_txt(10)
Insert cell
12%1
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