-
Notifications
You must be signed in to change notification settings - Fork 32
Алексей Вольхин #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
base: dev
Are you sure you want to change the base?
The head ref may contain hidden characters: "\u0410\u043B\u0435\u043A\u0441\u0435\u0439-\u0412\u043E\u043B\u044C\u0445\u0438\u043D"
Алексей Вольхин #21
Conversation
There was a problem hiding this 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)) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+2 балла
topic-1/task-2/index.js
Outdated
let doubledArray = []; | ||
for (i = 0; i < array.length; i++) | ||
{ | ||
if (array[i] !==0) |
There was a problem hiding this comment.
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]
topic-1/task-3/index.js
Outdated
return 1; | ||
} | ||
else { | ||
return n * factorial(n - 1); |
There was a problem hiding this comment.
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); | ||
} | ||
} |
There was a problem hiding this comment.
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]); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Доработать
There was a problem hiding this 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 = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Используй const
} | ||
|
||
} | ||
return doubledArray; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 балла
} | ||
|
There was a problem hiding this comment.
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 = []; |
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Решение достаточное.
Совет на будущее. Set работает намного эффективнее в сравнивании и прочем. Если захочешь разобраться, можешь подойти, разберем вместе)
No description provided.