Skip to content

fix: reject Roman numerals above 3999 in RomanToInt - #816

Open
kevin9327 wants to merge 1 commit into
TheAlgorithms:masterfrom
kevin9327:fix-roman-to-int-range
Open

kevin9327 wants to merge 1 commit into
TheAlgorithms:masterfrom
kevin9327:fix-roman-to-int-range

Conversation

@kevin9327

Copy link
Copy Markdown

What

RomanToInt now returns an error when the value is greater than 3999.

Why

The function documents that only standard form in the range 1 to 3999 is supported, and IntToRoman already rejects that range. MMMM was accepted as 4000.

Tests

Added a case for MMMM.

The function documents a maximum of 3999, and IntToRoman already
rejects that range, but MMMM was accepted as 4000. Return an error
instead and cover it with a test.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant