C
Size: a a a
C
Р
В
В
DM
DM
c
C
В
C
function f1(inp) {
let en = Object.entries(inp)
let keys = en.map(x => x[0])
let vals = en.map(x => x[1])
function* ptr() {
let ar = keys.map(x => 0)
let ls = vals.map(x => x.length)
let total = ls.reduce((a,v) => a * v, 1)
const inc = () => {
ar[0]++;
for (let i = 0; i < ar.length; i++) {
if (ar[i] === ls[i]) {
ar[i] = 0;
if (i < total - 1) {
ar[i + 1]++;
}
}
}
}
for (let i = 0; i < total; i++) {
yield ar;
inc()
}
}
let results = [];
for (const p of ptr()) {
results.push(
Object.fromEntries(
p.map((x, i) => [
keys[i],
vals[i][x]
])
)
)
}
return results;
}
C
В
c
В
function f1(inp) {
let en = Object.entries(inp)
let keys = en.map(x => x[0])
let vals = en.map(x => x[1])
function* ptr() {
let ar = keys.map(x => 0)
let ls = vals.map(x => x.length)
let total = ls.reduce((a,v) => a * v, 1)
const inc = () => {
ar[0]++;
for (let i = 0; i < ar.length; i++) {
if (ar[i] === ls[i]) {
ar[i] = 0;
if (i < total - 1) {
ar[i + 1]++;
}
}
}
}
for (let i = 0; i < total; i++) {
yield ar;
inc()
}
}
let results = [];
for (const p of ptr()) {
results.push(
Object.fromEntries(
p.map((x, i) => [
keys[i],
vals[i][x]
])
)
)
}
return results;
}
C
В
c
function f1(inp) {
let en = Object.entries(inp)
let keys = en.map(x => x[0])
let vals = en.map(x => x[1])
function* ptr() {
let ar = keys.map(x => 0)
let ls = vals.map(x => x.length)
let total = ls.reduce((a,v) => a * v, 1)
const inc = () => {
ar[0]++;
for (let i = 0; i < ar.length; i++) {
if (ar[i] === ls[i]) {
ar[i] = 0;
if (i < total - 1) {
ar[i + 1]++;
}
}
}
}
for (let i = 0; i < total; i++) {
yield ar;
inc()
}
}
let results = [];
for (const p of ptr()) {
results.push(
Object.fromEntries(
p.map((x, i) => [
keys[i],
vals[i][x]
])
)
)
}
return results;
}
C
DM
function f1(inp) {
let en = Object.entries(inp)
let keys = en.map(x => x[0])
let vals = en.map(x => x[1])
function* ptr() {
let ar = keys.map(x => 0)
let ls = vals.map(x => x.length)
let total = ls.reduce((a,v) => a * v, 1)
const inc = () => {
ar[0]++;
for (let i = 0; i < ar.length; i++) {
if (ar[i] === ls[i]) {
ar[i] = 0;
if (i < total - 1) {
ar[i + 1]++;
}
}
}
}
for (let i = 0; i < total; i++) {
yield ar;
inc()
}
}
let results = [];
for (const p of ptr()) {
results.push(
Object.fromEntries(
p.map((x, i) => [
keys[i],
vals[i][x]
])
)
)
}
return results;
}
4t