Skip to main content
Commonmark migration
Source Link

#Python 3, 74

Python 3, 74

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(1,x+1)))[::i]))for i in(1,-1))

#Python 3, 74

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(1,x+1)))[::i]))for i in(1,-1))

Python 3, 74

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(1,x+1)))[::i]))for i in(1,-1))
added 26 characters in body
Source Link
Morgan Thrapp
  • 3.7k
  • 15
  • 29

#Python 3, 8174

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(01,x+1)))[::i])+int(''.join(map(str,range)for i in(x,01,-1))))

#Python 3, 81

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:int(''.join(map(str,range(0,x+1))))+int(''.join(map(str,range(x,0,-1))))

#Python 3, 74

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(1,x+1)))[::i]))for i in(1,-1))
edited body
Source Link
Morgan Thrapp
  • 3.7k
  • 15
  • 29

#Python 3, 81

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:int(''.join(map(str,range(10,x+1))))+int(''.join(map(str,range(x,0,-1))))

#Python 3, 81

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:int(''.join(map(str,range(1,x+1))))+int(''.join(map(str,range(x,0,-1))))

#Python 3, 81

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:int(''.join(map(str,range(0,x+1))))+int(''.join(map(str,range(x,0,-1))))
Source Link
Morgan Thrapp
  • 3.7k
  • 15
  • 29
Loading