Xes plus Ys
Hello let's add some numbers. Here's a file. Every character in the file is at some x,y-position: The first character is at 1,1. The next one to the right is at 2,1 while the one below is at 1,2. And so on. We're interested in the x and y characters in the file. We want the sum of the y-values of all the y characters and the x-values of all the x characters. Because reasons, or at least we could imagine there being reasons, potentially.
Here's a smaller example with the x and y characters highlighted:
eusvytqrkg xvmbyfprld ezjvmffygc lxhyasfxnz ewnahyexjq inwlqdmmjv vifaooinbu aemhzikmep pinwbkwbqi fghketwyum
In this example the sum is 44:
- 1 (the y at 5,1)
- + 1 (the x at 1,2)
- + 2 (the y at 5,2)
- + 3 (the y at 8,3)
- + 2 (the x at 2,4)
- + 4 (the y at 4,4)
- + 8 (the x at 8,4)
- + 5 (the y at 6,5)
- + 8 (the x at 8,5)
- + 10 (the y at 8,10)
Show Me The Code!
Output
Submit Your Solution
What number do you get for the provided file?
Not logged in. You must sign up or log in before you can submit your solution!