• @Strawberry
    link
    1
    edit-2
    7 months ago

    Just don’t replace, or replace only the first letter with the numeral

    • @DaleGribble88@programming.dev
      link
      fedilink
      English
      17 months ago

      You can’t just replace the first letter either, because depending on the order of your replacements, you could be replacing the end of another number. (Encountered this exact problem trying to optimize my solution.)

      • @Strawberry
        link
        27 months ago

        As long as you replace any spelled out numbers from left to right it should work

        • @stifle867@programming.dev
          link
          fedilink
          17 months ago

          2oneight - if you replace from left to right you get 21ight or 21. This doesn’t work for part 2 as the answer should br 28.

          • @Strawberry
            link
            2
            edit-2
            7 months ago

            We’re talking about just the first letter, so

            2oneight —> 21neight —> 21n8ight