Files
freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-419-look-and-say-sequence.russian.md

56 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f5101000cf542c510022
challengeType: 5
title: 'Problem 419: Look and say sequence'
videoUrl: ''
localeTitle: 'Задача 419: посмотреть и сказать последовательность'
---
## Description
<section id="description"> Последовательность look and say переходит в 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211 ... Последовательность начинается с 1, а все остальные члены получаются путем описания предыдущего элемента в терминах последовательных цифр. Это помогает сделать это вслух: 1 «один» → 11 11 «два» → 21 21 «один два и один один» → 1211 1211 - «один, один два и два» → 111221 111221 «три, два и один» → 312211 ... <p> Определите A (n), B (n) и C (n) как число единиц, двойки и тройки в n-м элементе последовательности соответственно. Можно проверить, что A (40) = 31254, B (40) = 20259 и C (40) = 11625. </p><p> Найдите A (n), B (n) и C (n) для n = 1012. Дайте свой ответ по модулю 230 и разделите свои значения для A, B и C запятой. Например, для n = 40 ответ будет 31254,20259,11625 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: '<code>euler419()</code> должен возвращать 998567458, 1046245404, 43363922.'
testString: 'assert.strictEqual(euler419(), 998567458, 1046245404, 43363922, "<code>euler419()</code> should return 998567458, 1046245404, 43363922.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler419() {
// Good luck!
return true;
}
euler419();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>