Skip to main content
deleted 101 characters in body
Source Link

Pyt, 1717 15 bytes

Đб~⁺₂⇹Å*⇹ÅřǰąŁ⁺+б⁺0⇹?ŕ⇹:ŕ;ŘǰąŁ

Try it online!Try it online!

ĐĐ  Đ                   implicit input; Đuplicate twice
  ±                    get sign
   ~⁺₂                 negate, increment, divide by 2
      0            swap top two items onpush stack0
       Å            swap top two getitems
 Åbsolute value
   ?     *         if top of stack is multiplytruthy:
      ŕ⇹            ŕemove top of stack; swap top two items on stack
          Å            get Åbsolute value
           ř       otherwise: ŕemove top of řangifystack
            ǰ  ;        ǰoin withouteither delimitersway:
             ą     Ř    convert to ąrray of charactersŘangify
             ǰ Ł      ǰoin with getno Łengthdelimiters
               ą      incrementconvert (accountingto forąrray printingof 0)characters
                +Ł     get add;Łength; implicit print

Pyt, 17 bytes

Đб~⁺₂⇹Å*⇹ÅřǰąŁ⁺+

Try it online!

ĐĐ                     implicit input; Đuplicate twice
  ±                    get sign
   ~⁺₂                 negate, increment, divide by 2
                  swap top two items on stack
       Å               get Åbsolute value
        *              multiply
                      swap top two items on stack
          Å            get Åbsolute value
           ř           řangify
            ǰ          ǰoin without delimiters
             ą         convert to ąrray of characters
              Ł        get Łength
                     increment (accounting for printing 0)
                +      add; implicit print

Pyt, 17 15 bytes

б⁺0⇹?ŕ⇹:ŕ;ŘǰąŁ

Try it online!

Đ                   implicit input; Đuplicate
 ±                  get sign
                   increment
   0                push 0
                   swap top two items
     ?              if top of stack is truthy:
      ŕ⇹            ŕemove top of stack; swap top two items
                  otherwise: ŕemove top of stack
          ;         either way:
           Ř        Řangify
            ǰ       ǰoin with no delimiters
             ą      convert to ąrray of characters
              Ł     get Łength; implicit print
Source Link

Pyt, 17 bytes

Đб~⁺₂⇹Å*⇹ÅřǰąŁ⁺+

Try it online!

ĐĐ                     implicit input; Đuplicate twice
  ±                    get sign
   ~⁺₂                 negate, increment, divide by 2
      ⇹                swap top two items on stack
       Å               get Åbsolute value
        *              multiply
         ⇹             swap top two items on stack
          Å            get Åbsolute value
           ř           řangify
            ǰ          ǰoin without delimiters
             ą         convert to ąrray of characters
              Ł        get Łength
               ⁺       increment (accounting for printing 0)
                +      add; implicit print