   outer:
     while value > 0 {
       var position = 0
-      for i in position ..< romanTable.count {
-        let (v, s) = romanTable[i]
+      for (i, (key: s, value: v)) in romanTable[position...].enumerated() {
         if value >= v {
           result += s
           value -= Self(v)

  outer:
    while !input.isEmpty {
      var position = 0
      for i in position ..< romanTable.count {
        let (v, s) = romanTable[i]
        if input.starts(with: s) {
          self += Self(v)
          input = input.dropFirst(s.count)

    tags: [.api, .String, .algorithm])
]

let romanTable: DictionaryLiteral<String, Int> = [
  "M": 1000,
  "CM": 900,
  "D": 500,
  "CD": 400,
  "C": 100,
  "XC": 90,
  "L": 50,
  "XL": 40,
  "X": 10,
  "IX": 9,
  "V": 5,
  "IV": 4,
  "I": 1,
]

extension BinaryInteger {
