You have battled some fierce rivals for your spot in the 2019 code in the dark final, however to collect your prize and unlock a year of bragging rights you must solve the puzzle. It's simple enough to do, but can you manage it under pressure... with everyone watching...

To solve this problem you have to review a sequence of digits and find the **sum** of all digits that match the **next** digit in the list. The list is circular, so the digit after the last digit is the first digit in the list

For example:

- 1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit.
- 1111 produces 4 because each digit (all 1) matches the next.
- 1234 produces 0 because no digit matches the next.
- 91212129 produces 9 because the only digit that matches the next one is the last digit, 9.

To solve this you must link it with the form below which will allow a user to test **any** series of numbers that match this pattern. You must also print the resulting sum in the **#result** element. The example we have provided you is a test case, the real digits will be tested when the first 3 contestants are confident they have solved it and have stopped coding.

You have 15 minutes to work on a solution to this problem. If less than 3 contestants have solved it by the end of the timer we will allow an additional 5 minutes.

**The winner is whoever solves it fastest!** So if you're confident you have solved it raise your hand and stop coding!

What is the solution?