chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,21 +1,46 @@
|
||||
---
|
||||
id: 5900f3c51000cf542c50fed7
|
||||
title: 问题89:罗马数字
|
||||
title: 'Problem 89: Roman numerals'
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302204
|
||||
dashedName: problem-89-roman-numerals
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
对于以罗马数字书写的数字被认为有效,必须遵循基本规则。尽管规则允许以不止一种方式表达某些数字,但始终存在编写特定数字的“最佳”方式。例如,似乎至少有六种方式编写十六号:IIIIIIIIIIIIIII VIIIIIIIIII VVIIIIII XIIIIII VVVI XVI但是,根据规则,只有XIIIIII和XVI是有效的,最后一个例子被认为是最有效的,因为它使用最少数量的数字。 11K文本文件roman.txt(右键单击和'Save Link / Target As ...')包含一千个用有效但不一定是最小的罗马数字写的数字;请参阅关于...罗马数字,了解此问题的明确规则。通过以最小的形式编写每个字符来查找保存的字符数。注意:您可以假设文件中的所有罗马数字包含不超过四个连续的相同单位。
|
||||
For a number written in Roman numerals to be considered valid there are basic rules which must be followed. Even though the rules allow some numbers to be expressed in more than one way there is always a "best" way of writing a particular number.
|
||||
|
||||
For example, it would appear that there are at least six ways of writing the number sixteen:
|
||||
|
||||
<div style="margin-left: 4em; font-family: 'courier new', monospace;">
|
||||
IIIIIIIIIIIIIIII<br>
|
||||
VIIIIIIIIIII<br>
|
||||
VVIIIIII<br>
|
||||
XIIIIII<br>
|
||||
VVVI<br>
|
||||
XVI<br>
|
||||
</div>
|
||||
|
||||
However, according to the rules only XIIIIII and XVI are valid, and the last example is considered to be the most efficient, as it uses the least number of numerals.
|
||||
|
||||
The array, `roman`, contains one thousand numbers written in valid, but not necessarily minimal, Roman numerals; see [About... Roman Numerals](https://projecteuler.net/about=roman_numerals) for the definitive rules for this problem.
|
||||
|
||||
Find the number of characters saved by writing each of these in their minimal form.
|
||||
|
||||
**Note:** You can assume that all the Roman numerals in the array contain no more than four consecutive identical units.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler89()`应该返回743。
|
||||
`romanNumerals(roman)` should return a number.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler89(), 743);
|
||||
assert(typeof romanNumerals(roman) === 'number');
|
||||
```
|
||||
|
||||
`romanNumerals(roman)` should return 743.
|
||||
|
||||
```js
|
||||
assert.strictEqual(romanNumerals(roman), 743);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
Reference in New Issue
Block a user