Added solution for Project Euler problem 89. #3105
Added solution for Project Euler problem 89. #3105fpringle wants to merge 2 commits intoTheAlgorithms:masterfrom fpringle:problem_89
Conversation
dhruvmanila
left a comment
There was a problem hiding this comment.
Announcement:
This message is sent to all pull requests which are OPEN, NOT MERGED, not containing 'wontfix' label and contains 'Project Euler' or 'Project' or 'Euler' (case doesn't matter) in their title. If this message doesn't apply to your pull request, please ignore this.
Message:
This is to notify all the users submitting a pull request for the Project Euler solution that the README.md file has been updated with all the style requirements necessary for the directory and solution files. Please read through it and make all the necessary changes required to your submission.
|
Can anyone tell me what the protocol is for importing data for Project Euler problems? I.e. for this problem there's a file contain a list of words that need to be analysed. At the moment I'm defining them in a list in a separate file data.py and then importing them, but Travis doesn't like that. Should I leave them as a .txt file and us open()? Or move the list into the sol1.py file? |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Hi, @fpringle please take a look at https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_054/sol1.py#L367-L369. If you have any doubts, feel free to post a comment tagging me. |
|
Closing and reopening the pull request to run the latest test configuration. |
dhruvmanila
left a comment
There was a problem hiding this comment.
Please use a .txt file instead.
|
Closing since there's already a solution for Problem 89. |


Name: Roman numerals
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:
IIIIIIIIIIIIIIII
VIIIIIIIIIII
VVIIIIII
XIIIIII
VVVI
XVI
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 11K text file, roman.txt (right click and 'Save Link/Target As...'), contains one thousand numbers written in valid, but not necessarily minimal, Roman numerals; see 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 file contain no more than four consecutive identical units.
Reference: https://projecteuler.net/problem=89
Reference: #2695
Checklist:
Fixes: #{$ISSUE_NO}.