Skip to main content
added 446 characters in body
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 63 bytes

r.f.r
f('9':r)='a':r
f('z':r)='0':f r
f(c:r)=succ c:r
r=reverse

Try it online! Reverses the string and checks the first character:

  • A 9 is replaced by an a.
  • A z is replaced by a 0 and recursively the next character is checked.
  • All other characters are incremented using succ, the successor function which can be used on Chars because they are an instance of the Enum class.

Finally the resulting string is reversed again.

Haskell, 63 bytes

r.f.r
f('9':r)='a':r
f('z':r)='0':f r
f(c:r)=succ c:r
r=reverse

Try it online!

Haskell, 63 bytes

r.f.r
f('9':r)='a':r
f('z':r)='0':f r
f(c:r)=succ c:r
r=reverse

Try it online! Reverses the string and checks the first character:

  • A 9 is replaced by an a.
  • A z is replaced by a 0 and recursively the next character is checked.
  • All other characters are incremented using succ, the successor function which can be used on Chars because they are an instance of the Enum class.

Finally the resulting string is reversed again.

Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 63 bytes

r.f.r
f('9':r)='a':r
f('z':r)='0':f r
f(c:r)=succ c:r
r=reverse

Try it online!