Skip to main content
Commonmark migration
Source Link

#Haskell, 67 bytes

Haskell, 67 bytes

n('9':x)='0':n x n(c:x)=succ c:x n""="0" f x=reverse$iterate n""!!x 

this solution basically adds 1 the given number of times, in shortlex notation.

usage:

>f 9 "8" >f 100 "89" 

#Haskell, 67 bytes

n('9':x)='0':n x n(c:x)=succ c:x n""="0" f x=reverse$iterate n""!!x 

this solution basically adds 1 the given number of times, in shortlex notation.

usage:

>f 9 "8" >f 100 "89" 

Haskell, 67 bytes

n('9':x)='0':n x n(c:x)=succ c:x n""="0" f x=reverse$iterate n""!!x 

this solution basically adds 1 the given number of times, in shortlex notation.

usage:

>f 9 "8" >f 100 "89" 
Source Link
proud haskeller
  • 6.1k
  • 1
  • 24
  • 37

#Haskell, 67 bytes

n('9':x)='0':n x n(c:x)=succ c:x n""="0" f x=reverse$iterate n""!!x 

this solution basically adds 1 the given number of times, in shortlex notation.

usage:

>f 9 "8" >f 100 "89"