Ad
Fundamentals
Code
Diff
  • def numberprint(x):
        return int(''.join(map(lambda x: str(x), list(range(1, x + 1)) + list(range(x - 1, 0, -1)))))
    # harder to read but 1 line ¯\_(ツ)_/¯
    • def numberprint(x):
    • l1 = list(map(str, range(1, x + 1)))
    • l1.extend(l1[-2::-1])
    • return int(''.join(l1))
    • return int(''.join(map(lambda x: str(x), list(range(1, x + 1)) + list(range(x - 1, 0, -1)))))
    • # harder to read but 1 line ¯\_(ツ)_/¯