Size: a a a

2020 June 20

L

Lupusregina[beta] in pro.js
Aleksei Kowalski
А магазин?
ночь
источник

AK

Aleksei Kowalski in pro.js
Ночь и всё закрыто или ночь и страшно?
источник

L

Lupusregina[beta] in pro.js
Aleksei Kowalski
Ночь и всё закрыто или ночь и страшно?
ну круглосуточный далеко находится
источник

L

Lupusregina[beta] in pro.js
и ночью вокруг него странные личности собираются, так что я не пойду
источник

L

Lupusregina[beta] in pro.js
будет кто эту решать?
источник

НА

Николай Алиферов... in pro.js
Lupusregina[beta]
будешь решать?
по прошлой)  Testing for '462585023469229501280225859'
It should work for random inputs too - Expected: 3600, instead got: 2400
источник

AK

Aleksei Kowalski in pro.js
Lupusregina[beta]
будет кто эту решать?
Я бы завтра
источник

НА

Николай Алиферов... in pro.js
типа 0 это не цифра?)
источник

L

Lupusregina[beta] in pro.js
Николай Алиферов
по прошлой)  Testing for '462585023469229501280225859'
It should work for random inputs too - Expected: 3600, instead got: 2400
покажи код
источник

DE

Denis Efremov in pro.js
- 4
источник

L

Lupusregina[beta] in pro.js
Николай Алиферов
типа 0 это не цифра?)
цифра, у тебя ошибка где то
источник

НА

Николай Алиферов... in pro.js
function greatestProduct(digitsStr) {

   let maxProduct = 0;
   let offset = 0
   while (true) {
       let get5 = digitsStr.substr(offset, 5)
       if (get5.length < 5) break

       let product = get5.split('').reduce( (a,b) => a * b, 1 )

       if (product > maxProduct) maxProduct = product
       if (++offset > 20) break
   }

   return maxProduct
}
источник

L

Lupusregina[beta] in pro.js
Николай Алиферов
function greatestProduct(digitsStr) {

   let maxProduct = 0;
   let offset = 0
   while (true) {
       let get5 = digitsStr.substr(offset, 5)
       if (get5.length < 5) break

       let product = get5.split('').reduce( (a,b) => a * b, 1 )

       if (product > maxProduct) maxProduct = product
       if (++offset > 20) break
   }

   return maxProduct
}
ля, сколько расписал
источник

НА

Николай Алиферов... in pro.js
так это первая ката вообще с такого сайта)
источник

НА

Николай Алиферов... in pro.js
оно падает на некоторых и пишет It should work for random inputs too - Expected: 3600, instead got: 2400
источник

DE

Denis Efremov in pro.js
При чем тут 20?
источник

L

Lupusregina[beta] in pro.js
Николай Алиферов
оно падает на некоторых и пишет It should work for random inputs too - Expected: 3600, instead got: 2400
function greatestProduct(digitsStr) {
   let maxProduct = Number.NEGATIVE_INFINITY;

   let offset = 0
   while (true) {
       let get5 = digitsStr.substr(offset, 5)
       if ( get5.length < 5 ) break
       let product = get5.split('').reduce( (a, b) => a * b, 1 )
       if ( product > maxProduct )
         maxProduct = product
       offset++
   }

   return maxProduct
}
источник

L

Lupusregina[beta] in pro.js
const greatestProduct = s => s
 .split("")
 .reduce((m, v, i, a) =>
     i > a.length - 5 ? m :
       Math.max(m, a.slice(i, i + 5).reduce((s, v) => s * v, 1)),
   Number.NEGATIVE_INFINITY)
я так решил
источник

DE

Denis Efremov in pro.js
Language:
js


Source:
function greatestProduct(digitsStr) {
   let maxProduct = Number.NEGATIVE_INFINITY;

   let offset = 0
   while (true) {
       let get5 = digitsStr.substr(offset, 5)
       if ( get5.length < 5 ) break
       let product = get5.split('').reduce(


Errors:
676334445/source.js:9
});
^

SyntaxError: Unexpected token }
   at createScript (vm.js:80:10)
   at Object.runInThisContext (vm.js:139:10)
   at Module._compile (module.js:616:28)
   at Object.Module._extensions..js (module.js:663:10)
   at Module.load (module.js:565:32)
   at tryModuleLoad (module.js:505:12)
   at Function.Module._load (module.js:497:3)
   at Function.Module.runMain (module.js:693:10)
   at startup (bootstrap_node.js:188:16)
   at bootstrap_node.js:609:3
источник

L

Lupusregina[beta] in pro.js
давайте эту решим
источник