• kubica
    link
    fedilink
    244 days ago

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

    • r00ty
      link
      fedilink
      154 days ago

      Should it, or should it be “1”? (just removing one, one)

      • @grue@lemmy.world
        link
        fedilink
        44 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
      2
      edit-2
      4 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”)