(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#day 1 | |
*a,=map(int,open(0)) | |
print(sum(i<j for i,j in zip(a,a[1:]))) | |
print(sum(i<j for i,j in zip(a,a[3:]))) | |
#day 2 | |
from itertools import accumulate | |
print(sum(d:=[1j**'fd'.find(i[0])*int(i.split()[1]) for i in open(0)]).real*sum(d).imag) | |
print(sum(i.real*j.imag for i,j in zip(d, accumulate(d)))*sum(d).real) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/perl | |
# Emacs starter for Emacs mac port | |
# Thanks to Aquamacs Project and David Reitter | |
my $args = ""; | |
my $tmpfiles = ""; | |
for my $f (@ARGV) { |