VP 50: Number Pair (15 pts + 15 extra)

What You Need

Any computer with Python 3. You can also use an online Python environment, such as https://colab.research.google.com

Problem Statement

Given a list of numbers, find the two numbers that sum to 2020.

For example, consider this list:

1721
979
366
299
675
1456
In this list, the two entries that sum to 2020 are 1721 and 299.

That list is saved on my server with the filename "VP50".

Here is example code for Google Colab to download that list and display its contents.

!wget https://samsclass.info/COMSC122/proj/VP50

with open('VP50', 'r') as f:
  lines = f.readlines()

for l in lines:
  print(l.strip())

VP 50.1: Pair (15 pts)

Use this data:
https://samsclass.info/COMSC122/proj/VP50a
Find the two numbers that sum to 2020.
Multiply them together.
That number is the flag.

VP 50.2: Triplet (15 pts extra)

Use the same data as in the previous flag:
https://samsclass.info/COMSC122/proj/VP50a
Find three numbers that sum to 2020.
Multiply them together.
That number is the flag.

Source

Adapted from the Advent of Code.

Posted 8-28-25