Last active
September 12, 2016 11:03
-
-
Save timhuff/1245a19fceb4f6e30511b1d4832b4b6e 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
L?-b=dsm?.&.<1db3 4hlbydb@mXdH1mydSQ0 | |
L create lambda function named y with param b | |
? ternary if | |
- minus used for expressing "if d != b" | |
b lambda param | |
= assign | |
d d = | |
s sum | |
m map | |
? if | |
.& bitwise and | |
.< bitshift | |
1 1 literal | |
d map lambda param | |
b input | |
then | |
3 3 | |
else | |
4 4 | |
hlb 2nd param of map - [0..log2(b)] | |
ternary then | |
yd return y(d) | |
ternary else | |
b return b | |
@ grab zeroth element from array | |
m map | |
X B[A] += C | |
d the map lambda param | |
H the default pyth H={} | |
1 increment by 1 | |
m map | |
yd y(d) | |
SQ [1..input] | |
0 "zeroth element" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment