logo CodeStepByStep logo

JoltageAdapters2

Write a method named JoltageAdapters2 (similar to the previous exercise, joltageAdapters) that ... For example, suppose the file named joltage.txt contains the following values (shortened by ...):

16
10
15
5
1
11
7
19
6
12
4

... So the call of JoltageAdapters2("joltage.txt") should return 7 * 5 or 35.

You may assume that the file exists and is readable, that it follows the format described above, and that there will be at least one integer in the file.

(This exercise is based on the Advent of Code 2020, day 10.)

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.