Skip to content

Enchant NumeralSystem to accept complex system such as Roman numeral system. #8

@neizod

Description

@neizod

so this:

NumeralSystem({ 'I':    1, 'IV':   4, 'V':   5, 'IX':   9,
                'X':   10, 'XL':  40, 'L':  50, 'XC':  90,
                'C':  100, 'CD': 400, 'D': 500, 'CM': 900,
                'M': 1000 })

will returns correct Roman numeral system.

implementation details

  • key-value of input dict may be swap.
  • parse int -> str should be very easy (due to the rule)
  • parse str -> int require lexical (regex) analysis.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions