Skip to content

Instantly share code, notes, and snippets.

View sbrin's full-sized avatar

Mikhail Ilin sbrin

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<style>
#!/usr/bin/env sh
# остановить публикацию при ошибках
set -e
# сборка
npm run build
# переход в каталог сборки
cd dist
function maxLength(a, k) {
let result = 0;
for (let i = 0; i < a.length; i++) {
let arr = [];
if (a[i] <= k) {
let arraySum = 0;
for (let j = i; j < a.length; j++) {
if (arraySum + a[j] <= k) {
arraySum += a[j];
arr.push(a[j]);