• kubica@fedia.io
    link
    fedilink
    arrow-up
    24
    ·
    3 days ago

    Lets fix it. I think that since we are removing the ones, then “11” - 1 should be equal to “”.

      • grue@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        3 days ago

        Which “1” did it remove? And did it search the string to find a “1” to remove, or did it remove whichever character happened to be at array index 1?

    • Shanmugha@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      3 days ago

      Hear me out:

      “11” - 1 = “11” - (-1) = “11” (did not find “-1” in "11)

      Or

      “11” - 1 = “11” - (-1) = “1” (removed first “1”)