Skip to content

Алексей Вольхин #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

alexeyvolhin
Copy link

No description provided.

@daleunixal daleunixal assigned daleunixal and unassigned ievdokim Sep 20, 2021
Copy link
Contributor

@daleunixal daleunixal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дедлайн первого ревью.
+2 балла.
Задачи 2, 3 на доработке
Остальные максимум один балл, до конечного дедлайна.

function isTriangle(a, b, c) {
function isTriangle(a, b, c)
{
return ((a + b > c) && (a + c > b) && (b + c > a))
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+2 балла

let doubledArray = [];
for (i = 0; i < array.length; i++)
{
if (array[i] !==0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 - свободная ячейка.
Если она будет в начале массива, то твое решение завалит работу.
Пример:
[0,1,2,0,3,3,0,0]

return 1;
}
else {
return n * factorial(n - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не забываем про отступы при вложенности.

  • лучше избегать рекурсивных вызовов функций
    Каждый такой вызов будет создавать вспомогательный контекст в стеке, что потребует дополнительных ресурсов, как временных, так и по памяти.

}
else {
return n * factorial(n - 1);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Доработать

doubledArray.push(array[i]);
doubledArray.push(array[i]);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Доработать

Copy link
Contributor

@daleunixal daleunixal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 баллов, первое ревью


function calculateDoubleArray(array)
{
let doubledArray = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используй const

}

}
return doubledArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 балла

}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 балла

@@ -7,6 +7,13 @@
* @return {number} Количество уникальных имён
* */
function countUniqueName(nameArray) {
let names = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Используй const

names.push(highWord);
}
}
return names.length;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 балла

let names = [];
for (let word of nameArray) {
let highWord = word.toUpperCase();
if (!names.includes(highWord)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Решение достаточное.
Совет на будущее. Set работает намного эффективнее в сравнивании и прочем. Если захочешь разобраться, можешь подойти, разберем вместе)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants