DE
Size: a a a
DE
В
function sort(input) {
let result = [];
Object.keys(input).forEach((key) => {
let indexes = input[key];
indexes.forEach((index) => {
result[index] = key;
});
});
return result.join('');
}
S
function sort(input) {
let result = [];
Object.keys(input).forEach((key) => {
let indexes = input[key];
indexes.forEach((index) => {
result[index] = key;
});
});
return result.join('');
}
DE
const input = {
' ': [5],
d: [10],
e: [1],
h: [0],
l: [2, 3, 9],
o: [4, 7],
r: [8],
w: [6],
};
Object.values(Object.entries(input).reduce((acc, [key, val]) => {
val.forEach((idx) => {
acc[idx] = key
})
return acc
}, {})).join('')
S
const input = {
' ': [5],
d: [10],
e: [1],
h: [0],
l: [2, 3, 9],
o: [4, 7],
r: [8],
w: [6],
};
Object.values(Object.entries(input).reduce((acc, [key, val]) => {
val.forEach((idx) => {
acc[idx] = key
})
return acc
}, {})).join('')
DE
const arr = [];
Object.keys(input).forEach(key => input[key].forEach(n => arr[n] = key));
console.log(arr.join(''))
S
const arr = [];
Object.keys(input).forEach(key => input[key].forEach(n => arr[n] = key));
console.log(arr.join(''))
S
const input = {
' ': [5],
d: [10],
e: [1],
h: [0],
l: [2, 3, 9],
o: [4, 7],
r: [8],
w: [6],
};
const arr = [];
Object.keys(input).forEach(key => input[key].forEach(n => arr[n] = key));
console.log(arr.join(''));
DE
L
const obj= {
' ': [5],
d: [10],
e: [1],
h: [0],
l: [2, 3, 9],
o: [4, 7],
r: [8],
w: [6],
};
Object.entries(obj).reduce((a, [k, v]) => (v.map(i => a[i] = k), a), []).join("")
S
const obj= {
' ': [5],
d: [10],
e: [1],
h: [0],
l: [2, 3, 9],
o: [4, 7],
r: [8],
w: [6],
};
Object.entries(obj).reduce((a, [k, v]) => (v.map(i => a[i] = k), a), []).join("")
СЧ
F
DE
F
СЧ