►
From YouTube: Go Study Group - Advent of Code 2019 (days 1 & 2)
Description
The gang shares their Advent of Code 2019 submissions for the first couple of days
C
B
B
B
A
So
basically
we're
we're
dividing
something
and
then
we're
rounding
down
and
then
we're
subtracting
and
for
the
first
problem,
it's
just
a
simple
formula
that
gets
applied
once
right,
but
then
the
second
one
you
have
some
freedom
and
how
you
can
implement
that
because
you
can.
Even
this
goes
back
to
what
we
were
doing
with
the
binary
search
progression,
where
we
were
initially
doing
recursive
algorithms
to
figure
out
how
that
works
and
go
and
recursion
Z.
You
know
universal
thing
in
other
languages,
so
you
can
do
a
recursive
approach.
We
can
do
an
iterative
approach.
B
Yeah
I
don't
believe
in
recursion
there
yeah.
So
maybe
the
only
interesting
thing
here
is
that
I
don't
know
how
it
works
and
go
but
and
rust.
You
have
kind
of
like
default
math,
and
then
you
can
say
you
want
to
have
saturating
with.
So
in
this
case,
I'm
saying
if
this
goes
below
zero
on
this
unsigned,
you
64,
then
we'll
just
keep
it
at
zero.
B
B
C
B
B
Which,
let
me
show
you
input,
looks
like
so
anyway.
It's
just
a
bunch
of
lines,
so
I'm
just
taking
it
to
those
parsing
them
validating
that
they
do
actually
read
as
a
as
a
you
64
and
if
they
don't
read
as
usage
where
I
just
discard
the
line,
so
I
just
take
the
valid
input
and
then
so
then,
here
we
iterate
through
this
copy
just
means
that
well
anyway,
it's
complicated.
C
A
Fuel
sum
right:
okay,
yeah,
that's
nice,
that
you
have
like
this
mapping
ability
because
and
go
go,
doesn't
give
you
anything.
He
got
a
you
got
to
build
it
from
scratch
and
when
I
approached
the
problem,
I
was
thinking.
Oh
I'll
create
a
little
parser
to
like
go
through
the
string
and
split
it
by
newline
and
whatever.
A
A
B
D
A
Yeah
I
was
looking
at
that
and
it
reminds
me
of
another
problem
I've
seen
before,
but
I
don't
I,
don't
know,
I
don't
quite
know
yet.
If
the
solution
is
the
same,
like
I'm
trying
I'm
just
doing
naive,
brute-force
solutions
just
so
I
can
work
my
way
through
it
and
yeah.
If
I
have
time,
I'll
go
back
and
say:
oh,
can
I
optimize
this,
but
so
far
I
haven't
seen
the
need
to
do
that
with
the
way
the
the
problems
are
set
up.
A
B
A
A
Pretty
simple,
but
I
don't
have
that
parsing
code.
So
let
me
pull
up
my
my
test
setup.
That's
where
I,
like
hide
all
the
the
complexities
here,
so
my
approach
was
to
things
like
first
have
a
unit
test
to
use
the
sample
data
they
provide
because
they
have
like
in
this
case
they
have
four
small
sets
of
data
where
they
tell
you
exactly
what
you
you
expect
to
to
get
as
an
output.
Oh
whoops.
This
is
the
wrong
one.
Why
did
I
open?
This
is
the
right
one?
A
Example,
data
points
and
what
you
expect
the
result
to
be
so
I
created
a
test
just
for
that
to
make
sure
that
everything
was
working
correctly
and
then
I
created
a
separate
test
to
actually
create
the
the
results
for
my
custom
data.
So
my
custom
data,
like
I,
was
telling
you
guys
telling
everyone
that
the
the
modules
are
here
in
this
list:
I
just
copy
and
pasted
it
and
then
in
vim
I,
just
replaced
all
the
end
of
lines
with
commas.
A
So
yeah,
that's
how
I
did
it
so
I
had
to
avoid
doing
a
parser,
but
for
the
other
problems,
I
did
write
a
parser
just
because
they
were
more
complex.
Like
the
computer
code
problem,
it
has
like
a
letter
and
a
number
and
then
that's
all,
separated
by
commas
on
a
single
line.
This
problem
they
gave
it
to
you
on
new
lines,
so
I
just
copied
and
pasted
it
and
then
did
a
little
replace
job
so
yeah.
A
A
What
do
you
call
premature
optimization?
So
the
solution
you
can
see
is
pretty
simple,
like
I.
Just
rely
on
the
fact
that
it's
gonna
truncate
the
results
anyway,
because
we're
using
it
we're
changing
it
to
an
integer
here.
So
you
don't
need
to
use
any
kind
of
special
library.
The
the
the
point
you
brought
up
about
overflow,
that's
always
a
problem
and
go
I,
don't
typically
deal
with
it
very
much
so
I'm
not
really
sure
the
best
practice
and
go
for
that.
A
C
A
You
see
this
right
here
max
int,
eight,
it
figures
out
what
that
value
is,
and
so
I
think
you
can
figure
out
overflow
that
way,
but
I'm
not
absolutely
sure,
because
I
don't
do
a
lot
of
math
based
Haysom.
In
my
day-to-day
code.
A
A
Yeah
three
or
less
so
the
recursive
way
in
order
to
do
recursion,
you
have
to
have
a
base
case
right.
So
the
base
case
is:
is
this
right
here
any
time
that
fuel
is
not
greater
than
zero?
We're
just
gonna
return
fuel?
Otherwise,
if
fuel
is
a
positive
number,
then
we're
gonna
recurse.
So
it
looks
really
elegant,
but
you
have
to
like
every
time
you
do
something.
Recursive
like
this
I
want
to
have
a
test,
so
I
can
make
sure
that
it's
working
properly
because
there's
like
so
many
things
can
go
wrong.
A
A
So
initially
yeah,
initially
I
thought
we
were
gonna,
have
some
floating-point
numbers
and
so
I
just
started
that
way,
and
it
turns
out
that
everything
was
an
integer
and
I
just
kept
it,
but
I
don't
think
it
needs
to
be
a
float
because
well
so
everything
inside
of
here
is
gonna,
be
a
float
right
because
you
have
a
float
divided
by
what
it
I
think.
What
go
does.
Is
it
infers
since
that
you're
dividing
by
a
floating
type,
that
the
constant
should
also
be
a
floating
type?
A
So
this
is
a
float
divided
by
a
float
and
then
you're
gonna
cast
that
to
an
int,
but
it
actually
doesn't
matter
because
on.
If
you
look
at
the
recursive
solution
on
subsequent
the
first
time,
it
runs
you
provide
a
float
and
it
calculates
the
fuel
and
then
on
subsequent
runs
you're
taking
an
INT
and
casting
it
to
a
float.
So
you
you,
have
you
lack
precision,
there's
no
floating
values
there,
so
you
could
have
just
put
an
int
in
there.
So
I
think
we're
fine,
but
I
might
be
wrong
in
that.
A
So
I
have
to
I
have
to
do
a
little
research
and
get
back
to
you
and
if
we
need
to
have
a
float
but
yeah
I
think
well,
we
could
do
a
little
experiment
right
here.
We
can
change
this
to
an
int.
I
did.
A
A
D
C
A
Inputs,
I,
don't
think
the
inputs
randomized
yeah.
The
input
is
not
randomized
because
it
it's
so
this
is
a
slice
of
Struck's,
so
it's
ordered
so
it'll
always
run
in
the
same
order.
It's
always
gonna
run
these
in
the
order
they
appear.
If
this
were
a
map,
then
it
would
randomize
the
the
execution,
because
the.
A
Is
random
to
a
certain
respect,
but
yeah
this?
This
will
run
exactly
the
same.
Always
I,
don't
know
how
they
generate
this
data.
It
must
be
like
a
hash
of
your
email
or
something
that
is
used
as
a
seed
to
generate
all
this
data,
I'm
not
really
sure
how
they
they
came
up
with
this,
because
it
seems
like
it
I'm
guessing
they
have
a
fairly
stateless
service,
and
then
they
take
your
personal
info
and
they
they
just
use
that
to
consistently
create
this
data.
Yeah.
D
D
A
You,
if
you
like,
testing
this
way,
one
thing
that
you
can
do
instead
of
like
writing.
A
main
is
that
you
can
do
an
example
test.
Have
you
ever
seen
those.
D
A
An
example
test
is
a
test
that
runs,
but
you
you
don't
have
you
know
in
regular
tests.
They
have
testing
T
right
where
you
can
access
the
the
test
framework.
In
a
example
test
you
don't
have
access
to
that.
You
just
have
a
function
body
and
what
you
do
is
you
print
two
standard
out
and
then
you
use
comments
like
just
like
how
you
have
stuff
commented
out.
You
would
actually
put
comments
that
say:
output,
colon
and
then
you
would
put
what
you
expect
to
see
on
standard
out.
C
A
Doc,
web
server,
so
if
you
have
it
hosted
on
a
public
repo,
you
can
go
to
go
org
and
can
actually
see
your
example
test.
I
think
you
can
run
them
too
I'm,
not
sure
about
that
part,
but
yeah.
It's
kind
of
similar
to
this
style.
It's
like
oh
I,
want
to
print
something
to
screen.
I
want
to
print
something
standard
out
and
I
expect
this
value,
and
so
it's
a
really
handy
way
to
write
tests
that,
like
self
document,
it's
pretty
cool.
A
Yeah
see
I
see.
One
thing
that
you
did
differently
from
me
is
that
you
actually
scanned
everything
as
like
a
stream
you're
using
a
scanner
to
go
through
the
file
and
then
pick
it
apart
line
by
line,
so
that
the
whole
thing
isn't
loaded
in
memory
and
that's
pretty
smart,
because
the
way
I
did
it
I
just
hoped
that
it
wasn't
so
big
that
it
was
gonna,
become
unwieldy,
but
I
think
it
is
kind
of
unwieldy
because
it
like
took
up
the
entire
source
code
file
but
yeah
being
able
to
parse
it
like.
A
That
is
another
good
way
to
do
it.
That's
something
that
comes
up.
A
lot
is
just
making
sure
that
you
don't
load
everything
in
memory
and
ruin
like
server
performance,
because
all
the
memories
being
hogged
by
a
single
request,
so
yeah,
that's
that's
an
important
concept
and
go
cool.
Do
you
have
anything
else
you
want
share.
D
C
A
C
A
C
A
Just
kind
of
a
black
box
to
me:
Thanks
yeah,
no
problem
have
you
been
doing
the
the
advent
of
code?
Yes,
okay,
okay,
yeah
I'm
getting
caught
up
because
I
started
yesterday,
so
trying
to
power
through
and
catch
up
to
everyone
in
the
slack
jaw.
So
there's
a
slack
Channel
advent
of
code
that
a
bunch
of
people
are
having
discussions
about
the
problems.
So
if
you
want
to
participate,
that's
available,
okay,
cool
see
here,
I
can
share
the
the
next
day.
Let
me
go
back
to
my
screen,
my
giant
old
man,
fonts
screen.
A
A
A
You
read
the
first
bite
to
figure
out
what
operation
it
is
and
then
the
next
three
bites
are
your
parameters
for
that
operation
and
then,
once
you're
done
with
that,
you
go
to
the
next
bite
so
plus
four
from
where
you
started
one
two,
three
four
and
then
you
read
that
code
and
you
decide
what
to
do
next.
So
if
it's
99,
that
means
the
program's
done,
halt
you're
done
if
it's
one.
That
means
add
these
to
the
values
referenced
by
this
address
and
then
store
the
the
results
in
the
location
referenced
by
this
address.
A
So
now,
we've
got
pointers
and
we're
dereferencing
them
to
figure
out
where
to
put
the
value
or
referencing
to
find
out
where
it
should
be
stored.
So
this
is
a
pretty
cool
problem.
It's
it's
teaching
you
a
lot
of
things
like
you
might
be
it's
possible
to
do
this
problem
and
not
realize
how
much
you've
learned
because
there's
like
so
many
hidden
little
pieces,
so
I
really
like
this.
This
is
really
cool.
A
A
So
you've
got
one
program
there
to
plug
into
your
into
your
tests,
and
then
they
give
you
a
bunch
of
little
little
baby
programs
and
what
you
expect
the
program
to
look
like
at
the
end.
So
we've
got.
It
looks
like
five
sets
of
data
to
help
us
figure
out
if
our
computer
is
working
properly
before
we
start
to
run
the
main
program,
and
this
is
something
that
I
like
to
do
first,
because
I
know
that
these
little
baby
data
sets
are
much
easier
to
debug.
A
Then,
if
I
were
to
run
the
full
random
set
of
input
that
they
give
me
that
I
do
not
want
to
debug,
because
it's
just
there's
so
many
things
that
can
go
wrong
in
a
large
data
set
like
that.
I
want
to
keep
the
data
sets
as
small
as
possible
work
out
the
kinks
and
then
move
on
to
something
more
complex.
A
So
I'll
share
with
you
the
go
version
and
then
I'm
really
curious
to
see
the
rest
version.
After
this
will,
if
you,
if
you
don't
mind
sharing
so
the
this
time,
I
actually
did
write
a
a
parser.
So
this
parser
is
very
naive.
So,
like
Cindy
I
was
telling
you
like
I,
didn't
even
I.
Wasn't
gonna
get
too
concerned
about
streaming
it
line
by
line
or
byte
by
byte.
I
just
did
the
naive
thing,
which
is
loaded
into
memory
and
split
it.
A
So
you
can
see
the
raw
string
is:
where
is
it
must
parse?
Cuz
did
I
even
use
this?
Maybe
I
didn't
even
use
it.
Actually,
you
know
what
I
abandoned
this,
but
you
could
do
it
this
way.
You
just
split
it
on
the
the
comma
and
then
you
just
parse
for
integers
and
I.
Just
since
this
is
a
simple
program,
I
just
panic,
if
it
can't
parse
in
it,
because
that
means
the
input
is
wrong
and
we're
guaranteed
to
have
good
input.
So
the
program
will
just
panic.
A
So
one
thing
I
did,
that
was
a
little
fancy
and
I
probably
didn't
need
to
do.
Is
I
created
an
enum
type,
so
I
created
a
custom
type
of
opcode
and
then
I
assigned
opcode.
The
various
values
so
add
is
opcode.
One
multiplies
to
halts
is
99.
You
don't
really
need
to
do
this
if
you're
only
going
to
reference
it
in
one
place
and
that's
what
I
found
out
as
I
ran
through
the
program
is
that
it
was
overkill
because
I
only
needed
to
reference
the
codes
in
this.
A
This
function
execute
op
the
execute
op.
What
it
does
is
it
takes
the
input,
the
instruction
pointer,
which
I
just
call
I
and
then
all
of
the
codes
in
the
program.
So
all
it
does
is
it
takes
whatever's
at
I
and
then
it
does
a
switch
statement.
Is
it
a
add
multiplier
halt?
So
you
can
see
from
this
code
that
I
could
have
just
put
one
here
like
I.
A
A
If
you
look
over
here
on
the
left,
that's
the
instruction
pointer.
This
is
the
the
first
parameter
that
needs
to
be
dereferenced
and
then
second
value
that
needs
to
be
dereferenced.
So
in
this
case,
zero
refers
to
this
position
in
the
program.
Zero
again
refers
to
this
position,
and
then
we
want
to
store
that
at
one.
A
So
that's
what
happens
in
the
case
of
addition,
then,
if
it's
a
multiplication
problem
or
instruction,
so
you
can
see
here
we
have
a
multiplication
problem,
because
the
first
code
is
two
and
so
we're
taking
this.
Whatever
is
dereference
by
here
position,
three,
so
we're
starting
at
0,
0,
1,
2,
3,
so
3
times
the
the
data
at
position,
0
the
data
position.
0
is
2,
so
3
times
2
and
then
store
that
at
position,
3,
so
6
2
times
3
is
6
stored
at
position
3
and
then
halt
the
program.
So
that's
multiplication.
A
A
Is
you
have
to
realize
that
you're
not
executing
the
values
there
but
you're
executing,
what's
pointed
to
probably
those
values
that
we're
dealing
with
pointers
here
so
yeah
and
then
just
in
case
we
get
some
bad
data,
we're
gonna,
panic
and
say:
I,
don't
know
what
you're
talking
about
this
operation
code
is
invalid
and
that
never
happened
because
they
didn't
throw
any
curveballs
like
that.
It's
all
valid
data.
A
So
the
last
thing
is
really
important.
So
we're
gonna
execute
this
operation
and
then
we
need
to
return
a
value
that
says,
keep
proceeding
with
the
program
or
stop.
So
what
I
did
was
I
returned
a
negative
value.
If
we're
gonna
stop
otherwise
I
return,
the
next
place
the
instruction
pointer
should
go
so
normally
it's
going
to
be
you
add,
or
because
you're
skipping
ahead
those
three
parameters,
but
in
the
case
of
halt,
we're
gonna
return,
negative
one,
and
then
that
makes
our
program
loop,
pretty
simple.
A
So
if
you
look
at
the
bottom
here,
we
just
have
a
for
loop
and
our
instruction
pointer
starts
at
position,
zero
and
we're
running
we're
executing
codes,
and
if
that
instruction
pointer,
is
less
than
zero,
we
just
know
the
program
is
done:
we've
reached
a
halt
code,
otherwise
we
just
keep
going
forever.
So,
even
if
they
give
us
bad
data,
where
the
program
is
like
gonna
keep
going
forever,
it
it'll
actually
it'll
the
way
I
designed
it
it'll
stop.
When
the.
A
A
So
if
you
wanted
to
have
a
safe
program
that
doesn't
panic,
you
would
need
to
check
if
the
returned
pointer
here
on
line
55,
if
the
next
instruction
pointer,
if
that
is
not
within
the
bounds
of
the
code
slice,
then
that
means
you
need
to
return
some
kind
of
error
to
the
user.
So
it
doesn't
panic.
I
didn't
do
that,
though,
because
I
just
trusted
them
I
knew
there.
They
weren't
gonna,
give
any
curveballs.
A
A
If
you
wanted
to
optimize
this
for
real
world,
you
see
you
would
want
to
have
the
ability
to
stream
the
input
from
a
file
or
wherever
it's
coming
from.
So
the
the
most
complex
part
of
this
is
the
test.
Just
because
one
thing
I
wanted
to
do
with
this
test
is
I
didn't
want
to
use
a
testing
framework
to
compare
the
values.
A
So
one
of
the
things
and
go
is
that
you
cannot
compare
slices
because
slices
are
the
D
reference,
different
values
that
can
change
or
sorry
they
reference
different
values
that
can
change,
and
so
because
of
that
mutable
aspect
of
them.
They
don't
allow
you
to
compare
them.
So
you
can't
say
you
know:
does
this
program
equal
this
program?
It's
it's
not
gonna
work.
You
need
a
helper
function
to
do
that.
But
one
thing
it
does,
let
you
do
is
you
can
compare
strings.
A
So
if
you
have
a
slice
of
bytes,
you
know
that
that
slice
of
bytes
is
directly
translates
into
a
string.
So
you
just
convert
it
to
a
string
and
I,
don't
think
the
go.
Runtime
gives
you
a
penalty
when
you
convert
a
byte
slice
to
a
string
and
then
you
can
compare
them
that
way.
In
this
case
we
have
a
slice
of
intz
so
since
they're
in
sweeden
vert
them
directly
to
string,
but
what
we
can
do
is
we
can
use
the
the
func
tour
format,
library
to
create
a
string
representation
of
that
slice.
A
So
what
I
did
is
I
created
a
string
representation
of
the
what
I
actually
got
for
my
program
and
then
what
I
expected
and
I
just
compared
the
two
strings.
So
this
allows
you
to
get
around
using
a
test
framework
like
testify
or
kinko,
go
mega
or
whatever's
out
there.
There's
a
ton
of
them
and
another
thing
you
can
do
is
you
can
use
a
reflect,
the
reflect
library,
that's
part
of
this,
the
standard
Lib
and
you
can
use
that
to
do
like
a
deep
equals
and
say
you
know
just
a
slice
equal
that
slice.
A
But
this
is
nice,
because,
once
you
have
a
string
representation,
you
can
just
print
it
to
so
you
only
have
to
render
that
string
once
so.
You
can
see
here
my
log
messages,
I
I
say:
oh,
if
I
didn't
get
what
I
expected
I'm
gonna
print
that
output
to
screen.
So,
for
example,
if
I
change
this
right
and
then
I
run,
go
test,
run
test,
execute
program,
whoops
I
spelt
it
wrong.
A
A
So
the
the
creators
of
the
language
they
decided.
By
definition,
a
map
will
be
traversed
in
some
pseudo
random
way.
So
because
of
that,
you
cannot
print
deterministically.
But
now,
if
I
use
this
bump
dots
print
function
and
I
provide
a
map,
it
will
deterministically
print
that
map
every
time
and
go
1.13
and
the
way
it
does
that
is,
it
has
to
sort
the
keys
and
then
traverse
the
keys
in
sorted
order.
So
there's
a
penalty
to
doing
that.
A
So
if
you
had
a
giant
map,
you
have
to
take
that
into
account
when
you
print
it
as
a
string
now,
and
if
you
don't
want
that
feature,
then
you
have
to
traverse
it
yourself
so
that
you
don't
incur
that
penalty.
So
it's
kind
of
interesting
thing,
but
they
threw
that
in
there
so
that
it
would
be
easy
to
do
tests
if
you're
dealing
with
map
types
did
anybody
have
any
questions
about
that?
I
was
rambling
for
a
while
there.
A
So
one
thing
we
have
to
be
careful
about
is
we
don't
want
to
contaminate
our
test
data,
so
the
thing
that
I
did
is
I
created
a
copy
of
the
test
data.
So
this
is
the
input
at
the
end
of
the
test.
I
want
to
compare
or
sorry
I
guess
you
don't
need
to
worry
about
contaminating,
but
that
might
be
an
issue
in
other
situations,
but
I
did
it
anyway.
A
You
can
see
there's
some
differences
right
so
for
the
case,
for
the
sake
of
keeping
the
tests
clean,
we
make
a
fresh
copy
of
that
data
each
time,
so
we
allocate
a
a
integer
slice,
the
size
of
the
input,
and
then
we
copy
the
input
to
the
variable
we're
going
to
use
for
the
test,
and
then
we
use
that
variable
here.
So
that's
that's
important.
If
you
have
test
fixtures
that
are
shared
by
tests
in
this
case,
it's
not
because
each
one
of
these
are
only
used
once
exactly
once,
but
that's
not
always
the
case.
A
A
If
I
ran
more
than
one
test,
it
would
overwrite
that
variable
so
I
need
to
make
a
copy
of
it,
so
this
function
actually
creates
a
copy
every
single
time.
It's
gonna
return
this
literal
each
time
so
that
that
that
effectively
creates
the
copy
for
us.
So
when
we
get
to
part
two
of
the
problem,
so
it's
let
me
backtrack
a
little
bit
in
part
one.
We
run
our
program
and
they
tell
us
before
you
run
your
program.
A
You
need
to
fix
it
first
by
changing
these
two
values,
so
we
change
those
two
values
and
then
we
run
the
program
in
part
two
they
say:
okay,
we
don't
know
what
those
two
values
are
for
your
program
that
you
need
to
fix.
You
need
to
figure
that
out
and
it
can
be
between
each
value
can
be
between
0
and
99
inclusive.
A
So
basically,
I
just
have
two
for
loops
here
that
try
every
possible
combination
and
then,
when
we
find
the
magic
number
that
they
told
us
that
we
want
then
tell
us
what
those
two
magic
patched
values
are.
So
it's
very
important
that
I
have
a
fresh,
clean
copy
of
the
program.
Every
time
I
run
this,
because
if
I
contaminated
the
test
fixture,
then
each
attempt
would
be
futile
right,
like
it
just
wouldn't
work,
because
the
data
is
wrong.
A
So
yeah,
that's
something
important
in
testing
is
just
always
make
sure
that
you're
not
contaminating
your
test
fixtures.
If
you're
sharing
data
between
tests,
that
sort
of
thing-
and
in
this
case
we
are
actually
we're
doing
we're
dealing
with
mutability
here,
a
slice
is
mutable,
we're
changing
values.
So
if
we
want
a
fresh
copy,
we
have
to
explicitly
make
a
copy,
so
yeah
I
think
that's
enough
rambling
for
right
now,
I'm
gonna
take
a
sip
of
water.
Do
you
buddy
have
any
questions
about
that.
B
B
Alright,
that
should
be
the
right
one
yeah
so
like,
like
you,
said
Paul
in
the
mutability.
That's
a
problem,
so
my
solution
here
is
just
every
time.
I
call
this
calc
command,
which
calculates
the
end
result
of
the
program
and
just
clone
the
vector,
which
is
the
same
thing
as
you
know,
making
a
slice
and
go
and
then
I'm
passing
in
the
two
arguments
that
are
being
modified.
So
for
the
initial
one,
only
twelve
and
two,
and
then
we
have
to
do
the
like
factorial
solution
of
passing
in
0.99.
Until
we
get
that
value
that.
B
I'm,
so
in
the
actual
code,
so
we
here
we
dereference
or
reset
one
and
two
to
be
the
start
values,
and
then
we
just
loop
through
all
of
it,
stepping
by
four
or
and
then
we
set
the
first
index
to
be
the
value
of
one
second
extra
value
of
two
third
index
or
the
target
to
be
the
value
of
three.
And
then
we
just
use
this
match
statement,
which
is
like
a
select
and
go
essentially,
and
we
just.
A
So
that
match
statement
is
that
exactly
the
same
as
the
switchers
or
something
special
about
it,
cuz
I
think
I've
heard
this
a
bit,
because
this
is
like
pattern
matching
where
you
can
describe
it.
Yeah.
B
A
C
B
Say:
okay,
so
X
is
an
option.
We're
saying
if
it
is,
there
is
a
value
within
it
and
that's
something
inside
it
is
zero,
then
do
stuff.
Otherwise,
if
there's
some,
you
know
if
it
is
some,
but
it's
not
that
so
if
we
do
not
pass
this
test
here
then
do
something
else,
and
then
this
underscores
the
default
case
where
we
just
do
something
or
nothing
or
whatever.
So
that's
that's
the
kind
of
stuff
you
can
do
with
pattern.
Matching
they're.
A
I
always
wonder
about
that
with
programming
languages
like
when
they
use
a
lot
of
English
words
and
how
people
in
other
countries
who
may
not
speak
English
like
they
have
to
work
with
unless
they
have
like
a
localized
version
of
compiler,
they
have
to
work
with
the
same
keywords
right.
So
if
you
create
something,
that's
just
punctuation
based
it's
a
bit
more
localization,
friendly
I
would
think
yeah.
A
There's
a
cool
editor
for
mac,
it's
called
I
think
it's
caught.
Editor
is
what
it's
called:
it's
a
free
open-source
editor
and
it's
developed
by
some
Japanese
developers
and
they
made
it
so
that
it's
like
optimized
for
doing
the
Japanese
style
of
you
know
the
text
traversing
across
the
screen
and
but
it
works
great
for
western
style.
Also
like
it's
and
it's
a
really
cool
slick,
editor
I
wish
it
had
more
ability
to
like
integrate
plugins,
because
it's
it's,
it's
really
slick
and
really
well-designed
cool,
GG
I.
Think
it's
caught.
Co.
C
A
It's
it's
written
entirely
and
swift,
so
it's
like
got
all
the
latest
Apple
you
know
frameworks
and
all
that
that's
one
thing:
they
pride
themselves
on
yeah,
if
you
just
need
a
simple
text
editor
to
fire
up
once
in
a
while,
if
you
don't
want
to
use
vim
or
whatever
it's
it's
something
handy
to
have.
Besides
the
default
text
editor
on
Mac.
A
B
A
A
C
B
B
A
B
A
A
B
A
Cool
I
think
we're
just
about
out
of
time
we're
at
the
top
of
the
hour
here,
so
we
should
probably
cut
it
loose,
so
everyone
can
get
back
to
work
thanks
for
sharing
we'll
Cindy
thanks
for
sharing
Dimitri.
Thank
you
for
joining
I'm
glad
everyone
got
something
out
of
today.
The
event
I
think
what
we'll
do
next
week
is
we'll
just
continue
doing
some
more
problems.
A
If
anyone
wants
to
see
a
specific
problem,
just
shout
on
the
the
slack
Channel
and
I'll
take
a
look
at
that
and
try
to
focus
on
that,
because
otherwise,
if
no
one
requests
anything
I'm
just
going
to
keep
moving
on
from
day
three,
we
can
just
keep
sharing
in
chronological
order,
but
yeah.
If
you
have
solutions
you
want
to
share.