Created
March 7, 2019 14:16
-
-
Save jdonszelmann/218a278af0f584cde71e4c4e17d829c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/usr/bin/python3 | |
#https://codegolf.stackexchange.com/questions/123459/interleave-numbers-from-1-to-n-with-the-same-numbers-reversed | |
# c 1 | |
# m;i(n){for(m=n;m--;)printf("%d%d",n-m,m+1);} | |
# int main() { | |
# i(4); | |
# } | |
# python | |
# i=lambda n:"".join("%s"*2%(i+1,n-i)for i in range(n)) | |
# i=lambda n:"".join(map(lambda i:"%s"*2%(i+1,n-i),range(n))) | |
# i=lambda n:"".join(`i+1`+`n-i`for i in range(n)) | |
# js | |
# i=n=>{r="";for(i=n;i--;){r+=n-i;r+=i+1}return r} | |
# console.log(i(4)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment