Train Now

Start training on this collection. Each time you skip or complete a kata you will be taken to the next kata in the series. Once you cycle through the items in the collection you will revert back to your normal training routine.

Description

// Első megoldási kísérletem, de nagy számokkal hibásan fut le
function isDivisibleBy6(s) {
let finStrgArr = [];
let splitted = s.split('');
let asterisk = splitted.indexOf('*');
for (let i = 0; i < 10; i++) {
splitted[asterisk] = i;
if (splitted.reduce((a, b) => a + b, 0) % 6 === 0) {
finStrgArr.push(splitted.join(''));
}

}
return finStrgArr;
}

Ad