This website works better with JavaScript.
Explore
Help
Sign In
alpha
/
advent-of-code
Watch
1
Star
0
Fork
You've already forked advent-of-code
0
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6eec3568f8
main
renovate/configure
master
sorbet
profile
wip
Branches
Tags
${ item.name }
Create tag
${ searchTerm }
Create branch
${ searchTerm }
from '6eec3568f8'
${ noResults }
advent-of-code
/
2020
/
ruby
/
day_01.rb
4 lines
95 B
Raw
Blame
History
n
=
3
x
=
ARGF
.
read
.
split
.
map
(
&
:to_i
)
.
combination
(
n
)
.
find
{
|
x
|
x
.
sum
==
2020
}
p
x
.
reduce
(
&
:*
)
Reference in new issue
View Git Blame
Copy Permalink