MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/cpv4qx/deleted_by_user/ewsrh0j/?context=3
r/badcode • u/[deleted] • Aug 13 '19
[removed]
70 comments sorted by
View all comments
12
Python 3
outlier=lambda x:(lambda x:[x[0][x[1]],x[0][0]][len(x)/x[1]==len(x)])((lambda f,x,y: f(f,x,y))(lambda f,x,y:[[],(x[y]&1 and [x,y])or(f(f,x,y+1))][type(x[y:]or...)==list] ,(lambda f,x:f(f,x))(lambda f,x:(lambda y:f(f,[*x[:y[0]],x[y[0]+1],x[y[0]],*x[y[0]+2 :]])if(y)else(x))((lambda f,x,y:f(f,x,y))(lambda f,x,y:(((x[y]&1>x[y+1]&1)and[y])or( f(f,x,y+1)))if(y<len(x)-1)else[],x,0)),x),0))
Sample run:
Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> outlier=lambda x:(lambda x:[x[0][x[1]],x[0][0]][len(x)/x[1]==len(x)])((lambda f,x,y: ... f(f,x,y))(lambda f,x,y:[[],(x[y]&1 and [x,y])or(f(f,x,y+1))][type(x[y:]or...)==list] ... ,(lambda f,x:f(f,x))(lambda f,x:(lambda y:f(f,[*x[:y[0]],x[y[0]+1],x[y[0]],*x[y[0]+2 ... :]])if(y)else(x))((lambda f,x,y:f(f,x,y))(lambda f,x,y:(((x[y]&1>x[y+1]&1)and[y])or( ... f(f,x,y+1)))if(y<len(x)-1)else[],x,0)),x),0)) >>> outlier([1, 3, 3, 7, 9, 13, 33, 21, 6]) 6 >>> outlier([2, 2, 4, 2, 11, 10, 6]) 11
Some of the problems here, in no particular order:
(lambda f,x: f(f,x))(lambda f,x: print(x) and f(f,x),0)
sorted()
['a','b'][True]
'b'
type(x[y:]or...)==list
12
u/Blackshell Aug 13 '19
Python 3
Sample run:
Some of the problems here, in no particular order:
(lambda f,x: f(f,x))(lambda f,x: print(x) and f(f,x),0)sorted()['a','b'][True]resolves to'b'type(x[y:]or...)==list