Given an array of elements where every value has exactly two occurrences, we say that it is connectable if we can write the array on paper in a row and connect each pair of values from above without intersections.
For example, the array is not connectable, but is connectable:
Given an array of elements where every value has exactly two occurrences, a new array can be formed by either keeping or deleting both occurrences for each value. There are possible resulting arrays. Define the connectivity number of the original array to be the number of connectable arrays out of the resulting arrays.
For example, the connectivity number of is three, while the connectivity number of the following array is :
Attached is an array given as a comma-separated list. The array has elements consisting of values, each one having two occurences.
Find the connectivity number of the given array. Give your answer modulo .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.