Skip to content

solution#134

Open
tetiana-ivanchenko wants to merge 2 commits into
mate-academy:masterfrom
tetiana-ivanchenko:develop
Open

solution#134
tetiana-ivanchenko wants to merge 2 commits into
mate-academy:masterfrom
tetiana-ivanchenko:develop

Conversation

@tetiana-ivanchenko

Copy link
Copy Markdown

No description provided.

Comment thread src/rleCompress.js Outdated
*/
function rleCompress(source) {
// write code here
const result = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тема называется строки и числа, давай работать с ними (без массивов)

Comment thread src/rleCompress.js
Comment on lines +23 to +29
for (let i = 0; i < source.length; i++) {
let count = 1;

while (i < source.length - 1 && source[i] === source[i + 1]) {
count++;
i++;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

цикл в цикле, двойная сложность, это плохо, давай придумаем другое решение

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